| author | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-11-19 14:13:21 UTC |
| committer | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-11-19 14:13:21 UTC |
| parent | 4907cd1b429c1c3d35e211b7a08e4aabe1641e79 |
| borogove/Util.hx | +11 | -0 |
diff --git a/borogove/Util.hx b/borogove/Util.hx index 5670463..26cd50b 100644 --- a/borogove/Util.hx +++ b/borogove/Util.hx @@ -200,4 +200,15 @@ class Util { return index; } #end + + static public function capitalize(s:String):String { + if (s == null || s.length == 0) return s; + + var u: UnicodeString = s; + + var first = u.charAt(0).toUpperCase(); + var rest = u.substr(1, u.length - 1); + + return first + rest; + } }