Editing Module:UtilitiesGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 17: | Line 17: | ||
result = result:gsub("%s+", "", 1) -- Removes the postfixed space | result = result:gsub("%s+", "", 1) -- Removes the postfixed space | ||
end | end | ||
-- Trim any extra whitespace | -- Trim any extra whitespace | ||
result = result:gsub("^%s*(.-)%s*$", "%1") | result = result:gsub("^%s*(.-)%s*$", "%1") | ||
return result | return result | ||
end | |||
-- Remove '#' from hashtags, but keep the word (e.g., '#Atlas' becomes 'Atlas') | |||
function p.remove_hashtag(input, spaces) | |||
local result = input:gsub("#(%w+)", "%1") | |||
return result | |||
end | end | ||