Module:Utilities: Difference between revisionsGive feedback
Gammaton32 (talk | contribs) remove hashtags |
Gammaton32 (talk | contribs) created new function to remove hashtags |
||
| 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 | ||
| Line 25: | Line 22: | ||
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 | ||