1,124
edits
m (3 revisions imported: Importing from localhost) |
|||
Line 12: | Line 12: | ||
function com.trim(object) | function com.trim(object) | ||
--Use of while instead of if incase multiple whitespaces are present. | --Use of while instead of if incase multiple whitespaces are present. | ||
while string.sub(object, 1, 1) == ' ' do | if com.exists(object) then | ||
while string.sub(object, 1, 1) == ' ' do | |||
object = string.sub(object, 2) | |||
end | |||
while string.sub(object, string.len(object)) == ' ' do | |||
object = string.sub(object, 1, string.len(object) - 1) | |||
end | |||
end | end | ||