John117 Posted December 12, 2007 Share Posted December 12, 2007 (edited) hey if I have string 13215458Applesdfsdfsdfsd 6846465416Applesefsdfsdfsdfsdf How would I code this to insure that the return is always apple? And what if it was 465465464654 6565Apple56354654 54654646 And I only wanted it to be apple? btw this is an edit box value Edited December 13, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
martin Posted December 12, 2007 Share Posted December 12, 2007 hey if I have string13215458Applesdfsdfsdfsd6846465416ApplesefsdfsdfsdfsdfHow would I code this to insure that the return is always apple?And what if it was 4654654646546565Apple5635465454654646And I only wanted it to be apple? btw this is an edit box valueIf what you want is to return apple if the word apple is in the string then useIf StringInStr($string_to_search,"apple") then result = "apple"Is that what you mean? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
John117 Posted December 12, 2007 Author Share Posted December 12, 2007 Let me test itm but yes Link to comment Share on other sites More sharing options...
Valuater Posted December 12, 2007 Share Posted December 12, 2007 If what you want is to return apple if the word apple is in the string then useIf StringInStr($string_to_search,"apple") then result = "apple"Is that what you mean?I thought of that, then I figured if he knew it was apple, then why would he want to "get" apple from the list...Gues he wants to know if apple is in the list... 8) Link to comment Share on other sites More sharing options...
weaponx Posted December 12, 2007 Share Posted December 12, 2007 You can split the numbers from the letters like this: #include <Array.au3> $string = "6846465416Applesefsdfsdfsdfsdf" $fileNameArray = StringRegExp($string, "(\d*)(\D*)", 1) _ArrayDisplay($fileNameArray) Link to comment Share on other sites More sharing options...
John117 Posted December 13, 2007 Author Share Posted December 13, 2007 (edited) @ all, thanks for the education @ Valuater -its to check a sring hex to identify an exe as real -so yes, looking for *Apple now working btw Edited December 13, 2007 by Hatcheda 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