RDNWiki: DOWScar/Functions/String ...

RDN Wiki Home | Page Index | Recent Changes | Recently Commented | Users | Registration | Login:  Password:  

String Data Type


Contents


String is used for sentences, or text.


You have to declare a variable and contain the text you wish to include in double quotes, and there are special ways of attaching strings together, see the examples.


See the LUA Documentation on Strings for much more information.


Note that you have a libary of string functions inbuilt into LUA, see LUA Documentation on the String Libary for all the information you'll need on this.


It can be also used for names of SGroups? and EGroups?.

Example Code

function Test()
	-- Declare some strings
	local mystring1 = "hello"
	local mystring2 = "123"
	local mystring3 = "this is a sentence"

	-- Add strings together. You need to use "..", never "+"
	local mybigstring = "big string: " .. mystring1 .. mystring2
	-- big string: hello 123

--[[
	Example of invalid use:

	local mystring4 = "this will not
				appear on several lines"

	Which appears like:

		this will not appear on several lines

	This is the correct usage:

	local mystring5 = "this should \nappear on two lines"

	Or:

	local mystring5 = [[this should
 appear on two lines]]

	Which appears like:

		this should
		 appear on two lines
]]

end

Links


Data Types
Functions
SCAR Home
Wiki Home

End of Page

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]