Mast3rpyr0 Posted January 30, 2008 Posted January 30, 2008 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 My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
weaponx Posted January 30, 2008 Posted January 30, 2008 Its all in the help file... $test = "thisis aTest" $pos = StringInStr($test," ") $test2 = StringLeft($test, $pos - 1) MsgBox(0,"",$test2)
Mast3rpyr0 Posted January 30, 2008 Author Posted January 30, 2008 hey thanks man havent been around the language much since i started taking java classes (no pun intended). My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
seandisanti Posted January 30, 2008 Posted January 30, 2008 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)
Mast3rpyr0 Posted January 30, 2008 Author Posted January 30, 2008 oo cool thanks My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
rasim Posted January 31, 2008 Posted January 31, 2008 More solutions: $test = "thisis aTest" $test2 = StringRegExpReplace($test, "\s.*$", "") MsgBox(0,"output",$test2)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now