Sign in to follow this  
Followers 0
Mast3rpyr0

String help

6 posts in this topic

How can i strip a string of everything after a given delimiter such as whitespace?

something like

$test = "thisis aTest"

$test2 = function($test, " ")

$test2 would = "thisis"

is there a builtin function for this or would i need to make some kind of parser

Share this post


Link to post
Share on other sites



Its all in the help file...

$test = "thisis aTest"

$pos = StringInStr($test," ")

$test2 = StringLeft($test, $pos - 1)

MsgBox(0,"",$test2)

Share this post


Link to post
Share on other sites

hey thanks man havent been around the language much since i started taking java classes (no pun intended).

Nice one even if you meant to do it, and I'm typically not a fan of puns. Also, don't forget that you can combine your function calls:

$test = "thisis aTest"
$test2 = StringLeft($test,StringInStr($test," ") - 1)
MsgBox(0,"output",$test2)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0