String (type)

From ComputerCraft Wiki
Revision as of 13:06, 11 March 2014 by Scarjit (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page is a stub.
Please help us by expanding it.

A String represents an array of characters. For example, this text can be called a string. The default String functions in Lua 5.1, and the Textutils API, provid useful methods for manipulating strings.

For a more in-depth and concise explanation of types, please consult the Lua 5.1 Official Manual.

If you do not feel like viewing the Programming in Lua article, you can make a string by using quotation marks.

Example

string = "Hello"
print(string)
io.read() = variable
-- variable is a string
string1 = "123"
string2 = "4567890"
string3 = ""
string3 = string..string3
write(string3)
-- The Output should be: 12345678900
-- The Last 0 seem's to be an bug.