edy Posted October 18, 2004 Share 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" Link to comment Share on other sites More sharing options...
MHz Posted October 18, 2004 Share 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? Link to comment Share on other sites More sharing options...
edy Posted October 18, 2004 Author Share 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" Link to comment Share on other sites More sharing options...
edy Posted October 18, 2004 Author Share 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}> Link to comment Share on other sites More sharing options...
SlimShady Posted October 18, 2004 Share 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 Link to comment Share on other sites More sharing options...
edy Posted October 18, 2004 Author Share Posted October 18, 2004 Fine, thanks Link to comment Share on other sites More sharing options...
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