You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect that these are common enough needs that it would be nice to have them in the standard library.
Of course I know that I can already accomplish it with std.endsWith/std.startsWith, std.length and slice syntax:
local trimSuffix(str, suffix) =
ifstd.endsWith(str, suffix) then
str[0:std.length(str) - std.length(suffix)]
else
str;
I could also use std.strReplace if I was 100% sure the prefix/suffix would never exist anywhere else in the string.
I'm not sure what the goal of the standard library is. Perhaps you just want to provide the minimum set of building blocks for people to make their own methods like above. If the goal is instead to provide a suite of commonly used functions, these would be a great addition to it.
I'm in bradenton Florida need help Send help to me do not talk to any one I'm on Instagram Eduardo olivars this is baby wizard 2021 2022 I'm your creator and provider
Activity
Babywizard941 commentedon May 25, 2026
I'm in bradenton Florida need help Send help to me do not talk to any one I'm on Instagram Eduardo olivars this is baby wizard 2021 2022 I'm your creator and provider
Babywizard941 commentedon May 25, 2026
### ### ****local trimSuffix(str, suffix) =
if std.endsWith(str, suffix) then
str[0:std.length(str) - std.length(suffix)]
else
str;