Jump to content

Separate parts of the strings


Recommended Posts

hi,

i suggest using StringSplit(). This can split a part of a string using a 'delimiter'. This delimiter is a picked character.

example:

$var = StringSplit("12345|99", "|")
If Not $var[0] = 1 Then
 For $x=1 To $var[0]
  MsgBox(0, "", $var[$x])
 Next
EndIf

EXPLANATION:

The stringsplit command splits the string "12345|99" with the delimiter "|". The results (which is an array) is put into $var.

$var[0] ALWAYS shows how many elements are found. If $var[0] equals 1 means that NO occurences where found and the whole string is returned back to $var[1]. If there are more delimiters found it will be split into 1,2,3, etc. and the number of elements put into $var[0]

hope that helps :)

immense

Link to comment
Share on other sites

hi,

i suggest using StringSplit(). This can split a part of a string using a 'delimiter'. This delimiter is a picked character.

example:

$var = StringSplit("12345|99", "|")
If Not $var[0] = 1 Then
 For $x=1 To $var[0]
  MsgBox(0, "", $var[$x])
 Next
EndIf

EXPLANATION:

The stringsplit command splits the string "12345|99" with the delimiter "|". The results (which is an array) is put into $var.

$var[0] ALWAYS shows how many elements are found. If $var[0] equals 1 means that NO occurences where found and the whole string is returned back to $var[1]. If there are more delimiters found it will be split into 1,2,3, etc. and the number of elements put into $var[0]

hope that helps :)

immense

Thanks for the fast reply

Link to comment
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
 Share

  • Recently Browsing   0 members

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