Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add documentation on uniprops and update uniprop
to say it returns a Bool for Boolean Unicode properties
  • Loading branch information
samcv committed Dec 12, 2016
1 parent fe2a8bb commit 112ad2e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions doc/Type/Cool.pod6
Expand Up @@ -858,21 +858,36 @@ C<$pattern> is applied to the remaining characters of C<$string>.
say "perL 6".samecase("A__a__"); # Perl 6
say "pERL 6".samecase("Ab"); # Perl 6
=head2 method uniprop
=head2 routine uniprop
Defined as:
sub uniprop(Str(Cool), |c)
method uniprop(|c)
sub uniprop(Int:D $code, Stringy:D $propname)
sub uniprop(Str, $propname, Stringy:D $propname)
method uniprop(|c) { uniprop(self, |c)
Interprets the invocant as a L<Str|/type/Str>, and returns the
L<unicode property|http://userguide.icu-project.org/strings/properties> of the first
character. If no property is specified returns the
L<General Category|https://en.wikipedia.org/wiki/Unicode_character_property#General_Category>.
Returns a Bool for Boolean properties.
say 'a'.uniprop; # Ll
say '1'.uniprop; # Nd
say 'a'.uniprop('Alphabetic'); # 1
say '1'.uniprop('Alphabetic'); # 0
say 'a'.uniprop('Alphabetic'); # True
say '1'.uniprop('Alphabetic'); # False
=head2 routine uniprops
Defined as:
sub uniprops(Str:D $str, Stringy:D $propname = "General_Category")
Interprets the invocant as a L<Str|/type/Str>, and returns the
L<unicode property|http://userguide.icu-project.org/strings/properties> for each character
as a Seq. If no property is specified returns the
L<General Category|https://en.wikipedia.org/wiki/Unicode_character_property#General_Category>.
Returns a Bool for Boolean properties. Similar to L<uniprop|/routine/uniprop>
=head2 routine uniname
Expand Down

0 comments on commit 112ad2e

Please sign in to comment.