GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cli
  • FAQ
  • Reference
  • Building a Semantic CLI
  • From usethis::ui functions to cli
  • cli pluralization
  • Introduction to progress bars in cli
  • Advanced cli progress bars
  • cli color palettes
  • More articles...
  • Changelog

This view

  • Original page
  • New address

GeezerVison is showing cli.r-lib.org β€” Break an UTF-8 character vector into grapheme clusters β€” utf8_graphemes

Break an UTF-8 character vector into grapheme clusters

Source: R/utf8.R
utf8_graphemes.Rd

Break an UTF-8 character vector into grapheme clusters

Usage

utf8_graphemes(x)

Arguments

x

Character vector.

Value

List of characters vectors, the grapheme clusters of the input string.

See also

Other UTF-8 string manipulation: utf8_nchar(), utf8_substr()

Examples

# Five grapheme clusters
str <- paste0(
  "\U0001f477\U0001f3ff\u200d\u2640\ufe0f",
  "\U0001f477\U0001f3ff",
  "\U0001f477\u200d\u2640\ufe0f",
  "\U0001f477\U0001f3fb",
  "\U0001f477\U0001f3ff")
cat(str, "\n")
#> πŸ‘·πŸΏβ€β™€οΈπŸ‘·πŸΏπŸ‘·β€β™€οΈπŸ‘·πŸ»πŸ‘·πŸΏ 
chrs <- utf8_graphemes(str)
You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.