mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: Mar 2004
Posts: 457
D
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

Joined: Dec 2002
Posts: 1,922
O
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

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


Link Copied to Clipboard