How can I remove all spaces from a string on a moon?

Asked

Viewed 220 times

-1

i want to pick up a string and remove the white spaces contained in it.nome = algumacoisa imagine that this is a string, I want to remove the blank spaces between the "name" and the "=" and the "=" and the "somemacoisa"

1 answer

1


Use gsub. Thus s=s:gsub("%s+","").

The pattern %s+ means "one or more space characters (whitespace)".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.