motionman95 Posted July 23, 2010 Share 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 Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share 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 = '@#$(*!@(#*!@#(!*@###(*$"$%"#$%"!#!@"#@$"@#$%@#$"'). Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 'Polly goes for a walk, in "Central" Park' Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 Can you post the string? Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share Posted July 23, 2010 Can you post the string?It contains...sensitive information... Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 Ok, can you post an example that is similar? Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share 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. Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 Are you declaring the lines of these strings yourself; where are they from? Link to comment Share on other sites More sharing options...
StandardUser Posted July 23, 2010 Share 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. Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share 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. Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share Posted July 23, 2010 @871: I was considering that, except that the compiled exe is going to be use on multiple machines. Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share 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. Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 Example: #include <INet.au3> #include <Array.au3> $String = _INetGetSource('http://google.com') $String = StringSplit($String, '"') _ArrayDisplay($String) Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share 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) Link to comment Share on other sites More sharing options...
JohnOne Posted July 23, 2010 Share 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. Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share 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... Link to comment Share on other sites More sharing options...
motionman95 Posted July 23, 2010 Author Share Posted July 23, 2010 Does It matter whether the end string has single or double quotations throughout the string?Not understanding...? Link to comment Share on other sites More sharing options...
JohnOne Posted July 23, 2010 Share 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. 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