@acusti/textual 中文文档教程
@acusti/textual
用于转换和格式化文本(即字符串)的实用程序,包括:
capitalize(text: string)
返回与 text-transform: capitalize;
CSS 属性
getInitials(text: string)
从输入字符串中返回大写首字母,例如 getInitials('富兰克林·德拉诺·罗斯福') // => 'FDR'
getNameFromEmail(email: string)
从电子邮件地址返回格式化名称,将 .
和 +
视为 空格分隔符,例如 getNameFromEmail('franklin.delano+roosevelt@gmail.com') // =>; “富兰克林·德拉诺·罗斯福”
@acusti/textual
Utilities for transforming and formatting text (i.e. strings), including:
capitalize(text: string)
returns input text with equivalent formatting to the text-transform: capitalize;
CSS property
getInitials(text: string)
returns uppercase initials from the input string, e.g. getInitials('franklin delano Roosevelt') // => 'FDR'
getNameFromEmail(email: string)
returns a formatted name from an email address, treating .
and +
as space separators, e.g. getNameFromEmail('franklin.delano+roosevelt@gmail.com') // => 'Franklin Delano Roosevelt'
更多