Skip to content

Commit 75fb570

Browse files
committed
[Str] ord and ords
1 parent 08634a2 commit 75fb570

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/Str.pod

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ character can be uniquely classified as belonging to one range of characters.
274274
275275
=head2 pred
276276
277-
method pred(Str:D) returns Str:D
277+
method pred(Str:D:) returns Str:D
278278
279279
Returns the string decremented by one.
280280
@@ -285,4 +285,17 @@ C<Str.succ>). It fails on underflow
285285
'a0'.pred # Failure
286286
'img002.png'.pred # img001.png
287287
288+
=head2 ord
289+
290+
multi sub ord (Str:D) returns Int:D
291+
multi method ord(Str:D:) returns Int:D
292+
293+
Returns the codepoint number of the first character of the string
294+
295+
=head2 ords
296+
297+
multi method ords(Str:D:) returns Positional
298+
299+
Returns a list of codepoint numbers, one for each character in the string.
300+
288301
=end pod

0 commit comments

Comments
 (0)