yucatan Posted December 2, 2009 Posted December 2, 2009 hello guys i have a string my string = "rsync -vrtz --delete --progress /cygdrive/c/Documents and Settings/tw/test/ 127.0.0.1::asecretpwd" i wanne make a check if this is in the string:Documents and Settings then i wanne change it into'Documents and Settings' so the string is:"rsync -vrtz --delete --progress /cygdrive/c/Documents and Settings/tw/test/ 127.0.0.1::asecretpwd" i wanne change it into:"rsync -vrtz --delete --progress /cygdrive/c/'Documents and Settings'/tw/test/ 127.0.0.1::asecretpwd" can somebody help me on this? pleas
99ojo Posted December 2, 2009 Posted December 2, 2009 Hi, $string = "rsync -vrtz --delete --progress /cygdrive/c/Documents and Settings/tw/test/ 127.0.0.1::asecretpwd" If StringInStr ($string, "Documents and Settings") Then $string = StringLeft ($string, StringInStr ($string, "/Documents and Settings") ) & Chr (34) & "Documents and Settings" & Chr (34) & _ StringMid ($string, StringInStr ($string, "/Documents and Settings") + 23) MsgBox (0,"",$string) EndIf I guess that a StringRegExp Guru will jump the train as well... ;-)) Stefan
Mat Posted December 2, 2009 Posted December 2, 2009 StringReplace ($sString, "Documents and Settings", "'Documents and Settings'") is that it? that looks a bit simpler than what you had Mat AutoIt Project Listing
99ojo Posted December 2, 2009 Posted December 2, 2009 StringReplace ($sString, "Documents and Settings", "'Documents and Settings'")is that it? that looks a bit simpler than what you had MatHi Mat,i tried that as well and did a beginner mistake. I have had no replace because of faulty code.So i come up to my solution.Open eyes now......;-))Stefan
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