mIRC Home    About    Download    Register    News    Help

Print Thread
#38726 28/07/03 12:15 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
hi there

i need to use string functions like substr() from php. can someone help me?

for example %first should be the first 6 letters of "HELLOGUYS" (HELLOG)

and i %last should be the last 6 letters of "HELLOGUYS" ... or all letters from the 4th letter of "HELLOGUYS" (LOGUYS)

is there a chance to do this?


thx for answer

#38727 28/07/03 12:23 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
oh i think i've found it. sorry, i've postet to fast.

please delete thread

#38728 28/07/03 12:56 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Don't know what you found, but what you want is $mid()


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#38729 28/07/03 01:02 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
Thats it!

I've searched for "string funktions" and get something like $left $right $mid $pos ... etc pp

Thank your for your answer!

#38730 29/07/03 06:39 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$mid( ) will work of course, but I think what he asked for was based on end position; therefore, I think that he wants $left( ) and $right( ), in this instance, because of the way he phrased his question.

Quote:
%first should be the first 6 letters of "HELLOGUYS" (HELLOG)
  • var %left = $left(HELLOGUYS, 6)

Quote:
%last should be the last 6 letters of "HELLOGUYS"
  • var %right = $right(HELLOGUYS, 6)

Quote:
or all letters from the 4th letter of "HELLOGUYS"
  • var %right = $right(HELLOGUYS, -3)

    $right( , -3) because you're omitting the first 3 characters to start on the 4th.
Using $mid:

var %first = $mid(HELLOGUYS, 1, 6)
var %last = $mid(HELLOGUYS, 4)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard