Aassdd Posted February 26, 2008 Share Posted February 26, 2008 Is there a command like StringInStr but to check if a string starts with something? Link to comment Share on other sites More sharing options...
rasim Posted February 26, 2008 Share Posted February 26, 2008 Is there a command like StringInStr but to check if a string starts with something?StringLeft()StringRegExp() Link to comment Share on other sites More sharing options...
BigDod Posted February 26, 2008 Share Posted February 26, 2008 $i = "abcdefghijklmnopqrstuvwxyz" if StringLeft($i, 3) = "abc" Then MsgBox(0, "Result", "String started with abc") EndIf Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 26, 2008 Share Posted February 26, 2008 Hi, or build your own udfs Global $string = 'Hello World' If _StringStartsWith($string, 'hel') Then ConsoleWrite("OK(1)" & @CRLF) If _StringStartsWith($string, 'Hel', 1) Then ConsoleWrite("OK(2)" & @CRLF) If _StringStartsWith($string, '1Hel') Then ConsoleWrite("1" & @CRLF) Func _StringStartsWith($string, $start, $case = 0) If StringLen($start) > StringLen($string) Then Return -1 If $case > 0 Then If StringLeft($string, StringLen($start)) == $start Then Return 1 Else If StringLeft($string, StringLen($start)) = $start Then Return 1 EndIf Return 0 EndFunc ;==>_StringStartsWith 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...
Aassdd Posted February 26, 2008 Author Share Posted February 26, 2008 (edited) Thank you, another question, how can I delete the character from a string? (asd123jkl > asd123jk) Edited February 26, 2008 by Aassdd Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 26, 2008 Share Posted February 26, 2008 Thank you, another question, how can I delete the character from a string?(asd123jkl > asd123jk)Depends on what you got and what you what at the end. Show examples.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...
Aassdd Posted February 27, 2008 Author Share Posted February 27, 2008 Calculator > Backspace btn 123 > 12 Link to comment Share on other sites More sharing options...
rasim Posted February 27, 2008 Share Posted February 27, 2008 StringTrimRight Link to comment Share on other sites More sharing options...
Aassdd Posted February 27, 2008 Author Share Posted February 27, 2008 Thanks a lot BigDod, Xenobiologist and rasim. 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