blumi Posted March 20, 2012 Share Posted March 20, 2012 How is a @CRLF treated in AutoIt? I read a file and have a string. I want to check if at the end of the string is a @CRLF or not. Tried this: If (StringInStr($string, StringRight($string, 3)) = @CRLF) Then Link to comment Share on other sites More sharing options...
UEZ Posted March 20, 2012 Share Posted March 20, 2012 (edited) Try this: $txt = "This is a text" & @CRLF If StringInStr(StringRight($txt, 2), @CRLF) Then MsgBox(0, "Test", "Found CRLF at the end of the string!") Else MsgBox(0, "Test", "Not Found CRLF at the end of the string") EndIf Br, UEZ Edited March 20, 2012 by 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...
blumi Posted March 20, 2012 Author Share Posted March 20, 2012 Works fine, thank you UEZ Link to comment Share on other sites More sharing options...
Andreik Posted March 20, 2012 Share Posted March 20, 2012 Why it's need to call StringInStr, isn't enough to check the last two chars? $txt = "This is a text" & @CRLF If StringRight($txt, 2) = @CRLF Then MsgBox(0, "Test", "Found CRLF at the end of the string!") Else MsgBox(0, "Test", "Not Found CRLF at the end of the string") EndIf When the words fail... music speaks. 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