Jump to content

Recommended Posts

Posted (edited)

if my string looks like this:

$string = "joe/bob/mathew/john"

and i do:

StringSplit($string, "/")

how do i extract the last substring (in this case john) i got from stringsplitting the above string using the searchstring "/"

Edited by Hypertrophy
Posted

StringSplit puts the substrings it finds in an array, with the total number stored in array element 0. So:

#include <String.au3>

Dim $stringarray[100]

$string = "joe/bob/mathew/john"
$stringarray=StringSplit($string,"/")
MsgBox(0,"",$stringarray[$stringarray[0]])

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