Jump to content
Sign in to follow this  
Kiti

Substrings

Recommended Posts

Kiti

How can I get a substring? It should be something like:

$a = the substring
$b = "string"
$a = b.substring (2,6)
;$a would have to be "ring"

Does AutoIt support substrings?

Edit: I know about _StringSplit, but is there a more direct way, to select the number in a word of the first and last character your substring must have?

Edit2: Ok, I've got it :P I should use StringTrimLeft/Right. Sorry for the useless topic.:)

Edited by Kiti

Share this post


Link to post
Share on other sites
cppman

How can I get a substring? It should be something like:

$a = the substring
 $b = "string"
 $a = b.substring (2,6)
;$a would have to be "ring"

Does AutoIt support substrings?

Edit: I know about _StringSplit, but is there a more direct way, to select the number in a word of the first and last character your substring must have?

Edit2: Ok, I've got it :P I should use StringTrimLeft/Right. Sorry for the useless topic. :)

You should use StringMid. That function is specifically meant for what you are doing.

Share this post


Link to post
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
Sign in to follow this  

×