You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/stdlib/base.rst
+31-1
Original file line number
Diff line number
Diff line change
@@ -227,6 +227,12 @@ General Collections
227
227
228
228
For ordered, indexable collections, the maximum index ``i`` for which ``ref(collection, i)`` is valid. For unordered collections, the number of elements.
Convert a string to a contiguous UTF-8 string (all characters must be valid UTF-8 characters).
584
594
595
+
.. function:: is_valid_ascii(s) -> Bool
596
+
597
+
Returns true if the string is valid ASCII, false otherwise.
598
+
599
+
.. function:: is_valid_utf8(s) -> Bool
600
+
601
+
Returns true if the string is valid UTF-8, false otherwise.
602
+
603
+
.. function:: check_ascii(s)
604
+
605
+
Calls :func:`is_valid_ascii` on string. Throws error if it is not valid.
606
+
607
+
.. function:: check_utf8(s)
608
+
609
+
Calls :func:`is_valid_utf8` on string. Throws error if it is not valid.
610
+
611
+
.. function:: byte_string_classify(s)
612
+
613
+
Returns 0 if the string is neither valid ASCII nor UTF-8, 1 if it is valid ASCII, and 2 if it is valid UTF-8.
614
+
585
615
.. function:: search(string, char, [i])
586
616
587
617
Return the index of ``char`` in ``string``, giving 0 if not found. The second argument may also be a vector or a set of characters. The third argument optionally specifies a starting index.
0 commit comments