JackDinn Posted May 7, 2009 Share Posted May 7, 2009 $html="Mary had a little l/amb"$test=StringInStr($html,"/",0,-1)why $test=20 and not 4 ?occurrence:- [optional] Which occurrence of the substring to find in the string. Use a negative occurrence to search from the right side. The default value is 1 (finds first occurrence).im so dumb , what have i get wrong now (it is late, no excuse) Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
JackDinn Posted May 7, 2009 Author Share Posted May 7, 2009 nm, $test=StringLen($html-$test) will do, just looked like it should count backward to me from the description. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 7, 2009 Moderators Share Posted May 7, 2009 $html="Mary had a little l/amb" $test=StringInStr($html,"/",0,-1) why $test=20 and not 4 ? occurrence:- [optional] Which occurrence of the substring to find in the string. Use a negative occurrence to search from the right side. The default value is 1 (finds first occurrence). im so dumb , what have i get wrong now (it is late, no excuse)The returned character position is always left to right. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
UEZ Posted May 7, 2009 Share Posted May 7, 2009 $html="Mary had a little l/amb" $test=StringInStr($html,"/",0,-1) why $test=20 and not 4 ? occurrence:- [optional] Which occurrence of the substring to find in the string. Use a negative occurrence to search from the right side. The default value is 1 (finds first occurrence). im so dumb , what have i get wrong now (it is late, no excuse) I doesn't matter from which side you start to search a character - the result will always counted from the left side! If you need it from right side just reverse the string: #Include <string.au3> $html="Mary had a little l/amb" $test=StringInStr(_StringReverse($html),"/" ,0) MsgBox(0,"test",$test) UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Yashied Posted May 7, 2009 Share Posted May 7, 2009 I doesn't matter from which side you start to search a character - the result will always counted from the left side! If you need it from right side just reverse the string: #Include <string.au3> $html="Mary had a little l/amb" $test=StringInStr(_StringReverse($html),"/" ,0) MsgBox(0,"test",$test) UEZI think that _StringReverse() will be slower than StringLen(). My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
JackDinn Posted May 7, 2009 Author Share Posted May 7, 2009 aye me to but thx for the input anyhow . Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D 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