motionman95 0 Posted July 23, 2010 (edited) Yo, I have a string that has lots of ' " ' and other signs that would cause a string to break. This string is very long, and changes often. I would just use ' "" ' if I could. I want to be able to do something like this, and not worry about the ' " ' signs conflicting: $string = (<r><![CDATA[ "Polly goes for a walk, in "Central" Park" ]]></r>) Is there a way to do this in Autoit? Thanks in advance. Edited July 23, 2010 by motionman95 Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Depending on how long the string is, why not use & signs? Or check if there are any single quote signs (') and put the string inside of those, like $String = '@#$(*!@(#*!@#(!*@###(*$"$%"#$%"!#!@"#@$"@#$%@#$"'). Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 'Polly goes for a walk, in "Central" Park' Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 (edited) @epdmk The string is super long, it would take a long time to go through it. Plus it has a combination of ' and " symbols. BTW, thanks for replying and trying to help. Edited July 23, 2010 by motionman95 Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Can you post the string? Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 Can you post the string?It contains...sensitive information... Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Ok, can you post an example that is similar? Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 Ok, can you post an example that is similar?Thanks for being so patient!"if(bird = "'") { be='"' }"Something like that, except super duper long. It's actually a JS file for a site. Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Are you declaring the lines of these strings yourself; where are they from? Share this post Link to post Share on other sites
StandardUser 2 Posted July 23, 2010 I had a similar situation, so eventually ended up reading the long string from a file then assigning it to variable. Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 @epdmk Not understanding you - are you asking if the string is loaded, or if it is in the source of the au3? It is in the source of the au3. Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 @871: I was considering that, except that the compiled exe is going to be use on multiple machines. Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Well I was thinking in terms of making it an array instead.. if your grabbing the information for this string from a website or text file it would be as simple as that, an array. Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 (edited) @epdmk I'm sorry, earlier when I said "JS file" I meant it is a string of Javascript... But could you explain your Array idea? Edited July 23, 2010 by motionman95 Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 Example: #include <INet.au3> #include <Array.au3> $String = _INetGetSource('http://google.com') $String = StringSplit($String, '"') _ArrayDisplay($String) Share this post Link to post Share on other sites
Pottery 0 Posted July 23, 2010 In terms of what 871 said then you could try: FileWrite('tempfilename.txt', 'text') $String = FileRead('tempfilename.txt') FileDelete('tempfilename.txt') MsgBox(64, 'Example', $String) Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 23, 2010 Does It matter whether the end string has single or double quotations throughout the string? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 @epdmk I don't need the string turned into an array, (o_O). I just need to be able to do this: "Polly goes for a walk, in "Central" Park" Without worrying about getting errors. I also asked the question because I noticed that some languages had ways to do this... Share this post Link to post Share on other sites
motionman95 0 Posted July 23, 2010 Does It matter whether the end string has single or double quotations throughout the string?Not understanding...? Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 23, 2010 You have for example the string "'Mary' had a little "lamb", its nose 'was' "red" and 'white'" Would it matter to your script if it were ""Mary" had a little "lamb", its nose "was" "red" and "white"" ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites