Having " in a string (output)
#1

Hi all,
Just a quick query. Is there anyway i can have a ( " ) in a string? To be written to file? I cant seem to get it in there. I assumed it would be a bit like PHP. Entering an "\" before the actual ". However that didnt work. I knows its possible, ive done it before... Any ideas?

Thanks
Ash
Reply
#2

You did it like this?
pawn Код:
This is a quote \"hello\"
Reply
#3

Well yeh you can. Ex:
format(string,sizeof(string),"waazaa\"aa");
I used that in vb. And it works so..

Alien.
Reply
#4

Yes randomkid88 - i followed that pattern however it doesnt work.

Alien, as i explained in my first post, ive tried that and i had no luck.
Reply
#5

pawn Код:
SendClientMessage(playerid, 0xFFFFFFAA, "\"Here is my text\"");
It will be like:
"Here is my text"
Reply
#6

This doesnt work when saving to file, nor when formatting (format) a string.

Example;
(This a piece of update code for my Scripter's Tools script)
pawn Код:
format(string, sizeof(string), "Create3DTextLabel(\"%s\", COLOUR, %f, %f, %f, 20.0, 0, 0); //%s", orig, x, y, z, params);
As you can see, i have added the \" in the corresponding area, however this doesnt work. It doesnt show when i output as a "SendClientMessage" or when i save it to file.
Reply
#7

Erm, ill give it a try
Reply
#8

Thanks!

For some reason \" now works aswell :/ - It didnt when i tested it about 10 minutes ago
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)