generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Is there a way to display the " character in a string?

Previous Thread :: Next Thread 
BrendonTheWizard is not online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
31 Jan 2016 01:03 AM
I'm writing a script that displays text in a GUI, it would be useful to add " to it but that would simply close my string.
Report Abuse
larr1212 is not online. larr1212
Joined: 06 Jan 2015
Total Posts: 259
31 Jan 2016 01:06 AM
'"'
"\""
[["]]


Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
31 Jan 2016 01:06 AM
You could use single quotes to define your string instead of double quotes.

i.e. str = 'this is a " string " yeah?' would output: this is a " string " yeah?
Report Abuse
BrendonTheWizard is not online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
31 Jan 2016 01:10 AM
Thanks!
Report Abuse
Weaponizing is not online. Weaponizing
Joined: 09 Jan 2013
Total Posts: 4135
31 Jan 2016 02:11 AM
\"
Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
31 Jan 2016 04:33 AM
local validStrings = {
"\"Hello world.\"";
'"Hello world."';
[["Hello world."]];
"\34Hello world.\34";
(string.char(34) .. "Hello world." .. string.char(34));
}

for _, x in next, (validStrings) do
print(x)
end --[[> "Hello world."
"Hello world."
"Hello world."
"Hello world."
"Hello world."]]
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
31 Jan 2016 04:59 AM
you forgot
string.format("%q","Hello world.")
Report Abuse
Dodeca is not online. Dodeca
Joined: 11 Sep 2011
Total Posts: 13649
31 Jan 2016 05:00 AM
I always use double metal brackets [["Hello world."]]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image