Différences entre les versions de « Module:Common »

Aller à la navigation Aller à la recherche
39 octets ajoutés ,  23 décembre 2021 à 16:15
aucun résumé de modification
m (3 revisions imported: Importing from localhost)
Ligne 12 : Ligne 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
object = string.sub(object, 2)
while string.sub(object, 1, 1) == ' ' do  
end
object = string.sub(object, 2)
end
while string.sub(object, string.len(object)) == ' ' do
while string.sub(object, string.len(object)) == ' ' do
object = string.sub(object, 1, string.len(object) - 1)
object = string.sub(object, 1, string.len(object) - 1)
end
end
end
1 124

modifications

Menu de navigation