Trim whitespace from beginning of string (LUA)
A basic implementation to strip leading whitespace from a string lua
Similar To
- PHP: ltrim()
- Python: lstrip()
Details
- Language: LUA
Snippet
function ltrim(s)
return s:match'^%s*(.*)'
end
Usage Example
local a = ' abcde fg '
print( a )
print(ltrim(a))