Jump to content

Recommended Posts

Posted (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 by motionman95
Posted

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 = '@#$(*!@(#*!@#(!*@###(*$"$%"#$%"!#!@"#@$"@#$%@#$"').

Posted (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. :blink:

Edited by motionman95
Posted

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.

Posted

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.

Posted (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 by motionman95
Posted

Example:

#include <INet.au3>
#include <Array.au3>
$String = _INetGetSource('http://google.com')
$String = StringSplit($String, '"')
_ArrayDisplay($String)
Posted

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)
Posted

@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...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...