edy Posted October 18, 2004 Posted October 18, 2004 Is it possible with stringmid () extract string to left of start positon: example: $var = StringMid("string", 3, -2) MsgBox(0, "2 chars extracted from position 3 are:", $var) $var = "tr"
MHz Posted October 18, 2004 Posted October 18, 2004 If you want $var = "tr" $var = StringMid("string", 2, 2) MsgBox(0, "2 chars extracted from position 3 are:", $var) Does this help?
edy Posted October 18, 2004 Author Posted October 18, 2004 If you want $var = "tr"$var = StringMid("string", 2, 2) MsgBox(0, "2 chars extracted from position 3 are:", $var)Does this help?<{POST_SNAPBACK}>"string" is for example a substring of another string and i don't know the start position but i find it with the function StringInStr ().example:$stringa = " uno due tre 11/3/04 quattro cinque"$pos = StringInStr ( $stringa, "/" )$var = StringMid("string", $pos-1, -2)With the change of stringMid () $var must be "11"
edy Posted October 18, 2004 Author Posted October 18, 2004 "string" is for example a substring of another string and i don't know the start position but i find it with the function StringInStr ().example:$stringa = " uno due tre 11/3/04 quattro cinque"$pos = StringInStr ( $stringa, "/" )$var = StringMid($stringa, $pos-1, -2)With the change of stringMid () $var must be "11"<{POST_SNAPBACK}>
SlimShady Posted October 18, 2004 Posted October 18, 2004 (edited) It would be a nice addition. But you can do it by hand. I'll take your example: $stringa = " uno due tre 11/3/04 quattro cinque" $endpos = StringInStr ( $stringa, "/" ) $startpos = $endpos - 2 $var = StringMid($stringa, $startpos, $endpos - $startpos) MsgBox(0, "Test", "$var: " & $var) Edited October 18, 2004 by SlimShady
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now