Good Morning. How can I divide a string by spaces. In the case that it takes a string as a name and separates the first and last name by spaces.
Example:
James Kayser
String 01 =James
String 02 Kayser
String Division
Re: String Division
Code: Select all
strParts := StrSplit("James Kayser", " ")
MsgBox % strParts[1] "`n" strParts[2]
Re: String Division
Hallo,
or:
or:
Code: Select all
StringSplit, String0,% "James Kayser" ,% " "
MsgBox,% String01 "`n" String02
Re: String Division
Note that the StringSplit command is deprecated and no longer recommended for new scripts.