diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-03-28 09:02:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-28 09:02:26 +0000 |
| commit | edf97bdb03c3a845cd2adcbe6e424c1be44fcb39 (patch) | |
| tree | 97036a2d3a0253fd5a0a1ccb208f36bb1afb3ddf /src/string.cpp | |
| parent | 29a8707001d67aef44aeeaf9a912cfbe76e7e2dd (diff) | |
| parent | 9b3d381af048a0d12c45f4ea27ff435b3aeb698b (diff) | |
Merge pull request #4970 from odin-lang/bill/android-subtarget
Very Very Rudimentary Support for Android
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp index b001adf0e..88b679540 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -273,6 +273,15 @@ gb_internal String path_extension(String const &str, bool include_dot = true) { return substring(str, include_dot ? pos : pos + 1, str.len); } + +gb_internal String path_remove_extension(String const &str) { + isize pos = string_extension_position(str); + if (pos < 0) { + return str; + } + return substring(str, 0, pos); +} + gb_internal String string_trim_whitespace(String str) { while (str.len > 0 && rune_is_whitespace(str[str.len-1])) { str.len--; |