stockboy Posted November 10, 2006 Share Posted November 10, 2006 So say i have a string like this: example 1) Hello-Worldexample 2) Testing, Hello-World TestingHow would i delete everything AFTER the word 'Hello': example 1) Helloexample 2) Testing, HelloKeeping in mind that the string lengths and character positions change, but always follow this format.This topic is simular: http://www.autoitscript.com/forum/index.ph...mp;hl=characterTNX a lot Link to comment Share on other sites More sharing options...
Lempke Posted November 10, 2006 Share Posted November 10, 2006 (edited) Maybe you can use StringInStr () Look for the word hello You will get a number and add 5 (letters in hello) and use this to trim the string bij using StringLeft() Edited November 10, 2006 by Lempke Link to comment Share on other sites More sharing options...
stockboy Posted November 10, 2006 Author Share Posted November 10, 2006 TNX Lempke... it works, you made my day!!! $String = 'Hello-World' $OutPut = StringLeft($String, StringInStr($String, 'Hello') + 4) MsgBox(0, "String", $OutPut) Link to comment Share on other sites More sharing options...
Lempke Posted November 10, 2006 Share Posted November 10, 2006 TNX Lempke... it works, you made my day!!!$String = 'Hello-World'$OutPut = StringLeft($String, StringInStr($String, 'Hello') + 4)MsgBox(0, "String", $OutPut)Exept for the + 4 I wasn't sure about that :"> Link to comment Share on other sites More sharing options...
Xenobiologist Posted November 10, 2006 Share Posted November 10, 2006 Hi MsgBox(0,"",cutAfter('abc 12432141 Hello-World get it', "Hell")) Func cutAfter($string, $StringCutAfter) Return StringLeft($String, StringInStr($String, $StringCutAfter) + StringLen($StringCutAfter)-1) EndFunc So long, Mega crackdonalds 1 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...
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