Tsongkie Posted January 27, 2007 Share Posted January 27, 2007 Hi guys i hope this is possible with a string lets say its a long string like: inmycomputer&myfolderid=113579 what I need is the 113579. How do I extract that? Link to comment Share on other sites More sharing options...
Tsongkie Posted January 27, 2007 Author Share Posted January 27, 2007 also every string number i need like (113579) as stated in the example above this post begins with myfolderid= and then the number I need. I tried the help file but I cant find anything that works. so in pseudo it should look like this 1. find myfolder= in string 2. get the numbers after the "=" sign. thanks for the help. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 27, 2007 Share Posted January 27, 2007 Hi, #include<Array.au3> #include<String.au3> Global $string = "inmycomputer&myfolderid=113579" Global $found = StringRegExp($string, "\d{1,}", 3) _ArrayDisplay($found, "Deine Zahl") So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
PerryRaptor Posted January 27, 2007 Share Posted January 27, 2007 (edited) $What_I_Want = 113579 $ThisString = "inmycomputer&myfolderid=113579" $FindThis = '=' $LetsSee = StringTrimLeft ($ThisString , (StringInStr ($ThisString , $FindThis,0,-1))) MsgBox(0,"Help with String", $LetsSee) This searches the string from right to left looking for the '=' sign. It records the character position from left to right, then erases everything left of the '=', including the '=' too. Edited January 27, 2007 by PerryRaptor Link to comment Share on other sites More sharing options...
Zedna Posted January 27, 2007 Share Posted January 27, 2007 (edited) Another way:$string = "inmycomputer&myfolderid=113579" $found = StringSplit($string, "=") $found = $found[2] MsgBox(0,'Result', $found)EDIT: corrected $found[2], thanks PerryRaptor Edited January 27, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
PerryRaptor Posted January 27, 2007 Share Posted January 27, 2007 He wanted the serial number to the right of the equal sign so...$found = $found[2] Link to comment Share on other sites More sharing options...
xcal Posted January 27, 2007 Share Posted January 27, 2007 (edited) How about... $string = 'inmycomputer&myfolderid=113579' $hold = '' $array = StringSplit($string, '') Local $match[10] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] For $i = 1 To $array[0] For $x = 0 To 9 If $array[$i] = $match[$x] Then $hold &= $array[$i] Next Next MsgBox(0, 'Result', $hold) Ok, I was bored. @Rein: Don't do this. Edited January 27, 2007 by xcal How To Ask Questions The Smart Way 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