mIRC Home    About    Download    Register    News    Help

Print Thread
Upper/Lower case version of $len??? #89343 06/07/04 03:30 AM
Joined: Feb 2004
Posts: 9
M
mc9142 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 9
Is there an upper or lower case version of $len?
Or a way to make a string?
$upper($len(BlAh)), and the other way around both return 4.

Re: Upper/Lower case version of $len??? #89344 06/07/04 04:29 AM
Joined: Mar 2004
Posts: 457
D
Danthemandoo Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
Code:
lowerlen {
  return $len($removecs($1-,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))
}
upperlen { 
  return $len($removecs($1-,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z))
}


Usage:
$lowerlen(text) - returns $len of the lower cased letters only
$upperlen(text) - returns $len of the upper cased letters only
EG
$upperlen(qweRTYUIOP) will return 7
and
$lowerlen(qweRTYUIOP) will return 3

Re: Upper/Lower case version of $len??? #89345 06/07/04 05:08 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Alternatively, use $regex($1-,/[a-z]/g) for lowercase and $regex($1-,/[A-Z]/g) for uppercase laugh

Re: Upper/Lower case version of $len??? #89346 06/07/04 08:30 PM
Joined: Feb 2004
Posts: 9
M
mc9142 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 9
Thanks Guys laugh