@acusti/textual 中文文档教程

发布于 3 年前 浏览 12 项目主页 更新于 2 年前

@acusti/textual

最新版本依赖状态捆绑包大小downloads per month

用于转换和格式化文本(即字符串)的实用程序,包括:

capitalize(text: string)

返回与 text-transform: capitalize; CSS 属性

getInitials(text: string)

从输入字符串中返回大写首字母,例如 getInitials('富兰克林·德拉诺·罗斯福') // => 'FDR'

getNameFromEmail(email: string)

从电子邮件地址返回格式化名称,将 .+ 视为 空格分隔符,例如 getNameFromEmail('franklin.delano+roosevelt@gmail.com') // =>; “富兰克林·德拉诺·罗斯福”

@acusti/textual

latest versiondependencies statusbundle sizedownloads per month

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'

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文