txt: ## codes.md
  codes
  
  Combined from primary sources listed below.
  
  # [In Uni](#___top "go to top of document")[§](#(Uni)_method_codes "direct link")
  
  See primary documentation
  [in context](/type/Uni#method_codes)
  for **method codes**.
  
  ```raku
  method codes(Uni:D: --> Int:D)
  ```
  
  Returns the number of codepoints in the invocant.
  
  # [In Cool](#___top "go to top of document")[§](#(Cool)_routine_codes "direct link")
  
  See primary documentation
  [in context](/type/Cool#routine_codes)
  for **routine codes**.
  
  ```raku
  sub codes(Str(Cool))
  method codes()
  ```
  
  Coerces the invocant (or in sub form, its argument) to [`Str`](/type/Str), and returns the number of [Unicode code points](https://en.wikipedia.org/wiki/Code_point).
  
  ```raku
  say 'møp'.codes;    # OUTPUT: «3␤»
  ```
  
  The same result will be obtained with
  
  ```raku
  say +'møp'.ords;    # OUTPUT: «3␤»
  ```
  
  [ords](/routine/ords) first obtains the actual codepoints, so there might be a difference in speed.
  