Explorar el Código

Add `strings.contains_space`

gingerBill hace 1 año
padre
commit
9d7ab8d5ca
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      core/strings/strings.odin

+ 11 - 0
core/strings/strings.odin

@@ -346,6 +346,17 @@ Output:
 contains_any :: proc(s, chars: string) -> (res: bool) {
 	return index_any(s, chars) >= 0
 }
+
+
+contains_space :: proc(s: string) -> (res: bool) {
+	for c in s {
+		if is_space(r) {
+			return true
+		}
+	}
+	return false
+}
+
 /*
 Returns the UTF-8 rune count of the string `s`