summaryrefslogtreecommitdiff
path: root/mm/2s2h/ShipUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mm/2s2h/ShipUtils.cpp')
-rw-r--r--mm/2s2h/ShipUtils.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/2s2h/ShipUtils.cpp b/mm/2s2h/ShipUtils.cpp
index 3d5193cb4..ca4971391 100644
--- a/mm/2s2h/ShipUtils.cpp
+++ b/mm/2s2h/ShipUtils.cpp
@@ -109,6 +109,17 @@ std::string Ship_FormatTimeDisplay(uint32_t value) {
return fmt::format("{}:{:0>2}:{:0>2}.{}", hh, mm, ss, ds);
}
+std::string Ship_RemoveSpecialCharacters(const std::string& str) {
+ std::string result;
+ for (char ch : str) {
+ // Only keep alphanumeric characters (letters and digits)
+ if (std::isalnum(static_cast<unsigned char>(ch))) {
+ result += ch;
+ }
+ }
+ return result;
+}
+
constexpr f32 fourByThree = 4.0f / 3.0f;
// Gets the additional ratio of the screen compared to the original 4:3 ratio, clamping to 1 if smaller