aboutsummaryrefslogtreecommitdiff
path: root/pseudocode-lib/_exp_string.cc
diff options
context:
space:
mode:
Diffstat (limited to 'pseudocode-lib/_exp_string.cc')
-rw-r--r--pseudocode-lib/_exp_string.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/pseudocode-lib/_exp_string.cc b/pseudocode-lib/_exp_string.cc
index d406274..6155319 100644
--- a/pseudocode-lib/_exp_string.cc
+++ b/pseudocode-lib/_exp_string.cc
@@ -1,4 +1,5 @@
#include <algorithm>
+#include <cctype>
#include <cstdio>
#include <exception>
#include <stdexcept>
@@ -88,6 +89,18 @@ void _exp_string_impl_mid(void *Target, void *Handle, long long Start, long long
text(Target) = Source.substr(Position, Length);
});
}
+void _exp_string_impl_lcase(void *Target, void *Handle) {
+ checked([&] {
+ text(Target) = text(Handle);
+ for (char &Ch : text(Target))
+ Ch = static_cast<char>(std::tolower(static_cast<unsigned char>(Ch)));
+ });
+}
+char _exp_string_impl_lcase_char(char Ch) {
+ return checked([&] {
+ return static_cast<char>(std::tolower(static_cast<unsigned char>(Ch)));
+ });
+}
void _exp_string_impl_output(void *Handle) {
checked([&] {
const auto &Text = text(Handle);