Whitespace: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
No change in size ,  27 April 2023
m
Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
m (Text replacement - "</code>" to "</SyntaxHighlight>")
m (Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">")
Line 5: Line 5:
{{Example|
{{Example|
Without (most) whitespace:
Without (most) whitespace:
<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
number=476
number=476
disgusting_food="fried chicken"
disgusting_food="fried chicken"
Line 11: Line 11:


With whitespace:
With whitespace:
<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
number          = 476
number          = 476
disgusting_food = "fried chicken"
disgusting_food = "fried chicken"
Line 19: Line 19:
=== Tabs ===
=== Tabs ===
Tabs are used to organize scripts after:
Tabs are used to organize scripts after:
<SyntaxHighlight code="lua">do
<syntaxhighlight lang="lua">do
then
then
repeat</SyntaxHighlight>
repeat</SyntaxHighlight>
{{Example|
{{Example|
Without tabs:
Without tabs:
<SyntaxHighlight code="lua">if 1 == 1 then
<syntaxhighlight lang="lua">if 1 == 1 then
while true do
while true do
print("One is equal to one!")
print("One is equal to one!")
Line 35: Line 35:


With tabs:
With tabs:
<SyntaxHighlight code="lua">if 1 == 1 then
<syntaxhighlight lang="lua">if 1 == 1 then
while true do
while true do
print("One is equal to one!")
print("One is equal to one!")
Line 50: Line 50:
{{Example|
{{Example|
Without newlines:
Without newlines:
<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
print("test") --> test
print("test") --> test
</SyntaxHighlight>
</SyntaxHighlight>


With newlines:
With newlines:
<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
print(
print(
"test"
"test"
Line 66: Line 66:
If you put extra whitespace in a string, the whitespace won't be ignored.
If you put extra whitespace in a string, the whitespace won't be ignored.
{{Example|
{{Example|
<SyntaxHighlight code="lua">print("Hello world!") --> Hello world!
<syntaxhighlight lang="lua">print("Hello world!") --> Hello world!
print("Hello            world!") --> "Hello            world!"
print("Hello            world!") --> "Hello            world!"


Navigation menu