strplus.version
This function just print the current version of the script
Code :
dofile('stringplus.lua')
strplus.version()
Output:
Current version of String+ is (Script Version)
strplus.color
strplus.color(<string: rgb>,<string: text>)
This function return colored string "©".
assert(strplus.color('255255255','Hi, this is my colored string!') == '©255255255Hi, this is my colored string!')
(Note: Im using ANSI charset of "©" (169) so there's no "Â" in the string)
strplus.split
strplus.split(<string: text>[,<string: strpattern>])
This function return table of the splitted string (Use For ipairs / pairs loop)
assert(strplus.split('Hi Hello','%s') == {'Hi','Hello'})
strplus.separate / strplus.sep
strplus.separate(<string: text>)
This function return table of the string one-by-one ("abc " to {"a","b","c"," "})
assert(strplus.sep('123') == {'1','2','3'})
strplus.isupper / strplus.up
strplus.isupper(<string: text>[,<bool: ignorewhitespace>])
This function return a boolean value if the string is uppercase (If let the "ignorewhitespace" to nil, it will automatically set the value to false)
assert(strplus.up('ILOVELUA') == true)
assert(strplus.up('ihateLua') == false)
assert(strplus.up('I LOVE LUA WITH SPACES',true) == true)
assert(strplus.up('I HATE lua WITH SPACES',true) == false)
strplus.islower / strplus.low
strplus.islower(<string: text>[,<bool: ignorewhitespace>])
This function return boolean value, same as
strplus.isupper function but its for lowercase string.
assert(strplus.low('ilikeluajit') == true)
assert(strplus.low('ihateLuajit') == false)
assert(strplus.low('i like luajit with spaces',true) == true)
assert(strplus.low('i hate Luajit with spaces',true) == false)
strplus.isalpha / strplus.alph
strplus.isalpha(<string: text>)
This function return bool value, its the mixed version of
isupper &
islower but not supported for whitespace.
assert(strplus.alph('Rawr') == true)
assert(strplus.alph('Rawr!') == false)
strplus.isnum / strplus.num
strplus.isnum(<string: num/digit>)
This function return bool value if the string is a digit / number, i don't know if this function support float?
assert(strplus.num('1') == true)
assert(strplus.num('a') == false)
strplus.isansi / strplus.ansi
strplus.isansi(<string: ansidigit>)
This function return bool value if the digit is actually return an ANSI charset.
assert(strplus.ansi('0') == true)
assert(strplus.ansi('100000') == false)
strplus.isalphanum / strplus.alphnum
strplus.isalphanum(<string: text>)
This function return a bool value. The function return true if the string is alphanumeric, else return false.
assert(strplus.alphnum('12 and 3') == true)
assert(strplus.alphnum(strplus.alphnum('12 & 3') == false)