The Hacker's Language in Action: #3 Strings

in software •  7 years ago 

Strings in Lua are sequences of bytes... Lua is eight-bit clean and its strings can contain bytes with any numeric code, including embedded zeros.

Roberto Ierusalimschy.

portada_lua.png

Basics: a change, length operator and concatenation operator

lua_strings_1.png

Escape sequences in Lua

C-like Escape SequenceCharacter
\abell
\bbackspace
\fform feed
\nnewline
\rcarriage return
\thorizontal tab
\vvertical tab
\\backslash
\"double quote
\'single quote

lua_strings_2.png

Corecions

lua_strings_3.png

The String Library

lua_strings_4.png

Format and More:

lua_strings_5.png

Unicode

lua_strings_6.png

References

  • Roberto Ierusalimschy, Programming in Lua, Fourth Edition.
  • lua.org

Previous post

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

About Hacking, Is Lua better that Python?

Maybe the response is in this post about hackers