Jump to content

Recommended Posts

Posted

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

Posted

Its all in the help file...

$test = "thisis aTest"

$pos = StringInStr($test," ")

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

MsgBox(0,"",$test2)

Posted

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)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...