Published: 2017-06-03 10:29:42 +0000
Categories:
LUA,
Language
LUA
Description
A basic implementation to strip leading whitespace from a string lua
Similar to
- PHP: ltrim()
- Python: lstrip()
Based On
Snippet
function ltrim(s)
return s:match'^%s*(.*)'
end
Usage Example
local a = ' abcde fg '
print( a )
print(ltrim(a))
Keywords
ltrim, lstrip, trim, whitespace, leading, remove,