aboutsummaryrefslogtreecommitdiff
path: root/core/strings
diff options
context:
space:
mode:
Diffstat (limited to 'core/strings')
-rw-r--r--core/strings/strings.odin2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin
index 6e004993a..a477b9e13 100644
--- a/core/strings/strings.odin
+++ b/core/strings/strings.odin
@@ -52,6 +52,8 @@ unsafe_string_to_cstring :: proc(str: string) -> cstring {
return cstring(d.data);
}
+// Compares two strings, returning a value representing which one comes first lexiographically.
+// -1 for `a`; 1 for `b`, or 0 if they are equal.
compare :: proc(lhs, rhs: string) -> int {
return mem.compare(transmute([]byte)lhs, transmute([]byte)rhs);
}