summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/str.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/str.go b/lib/str.go
index c93ca12..98b16e9 100644
--- a/lib/str.go
+++ b/lib/str.go
@@ -116,3 +116,15 @@ func StrSplitAt(c byte, s string) []string {
}
return l
}
+
+func StrToUpper(s string) string {
+ us := ""
+ for i := 0; i < len(s); i++ {
+ if 'a' <= s[i] && s[i] <= 'z' {
+ us += string('A' + (s[i] - 'a'))
+ } else {
+ us += string(s[i])
+ }
+ }
+ return us
+}