UNPKG

@visactor/vmind

Version:

<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu

11 lines (8 loc) 508 B
export const getLanguageOfText = text => (text || "").match(/[\u4e00-\u9fa5]/) ? "chinese" : "english"; export const capitalize = str => "string" != typeof str ? "" : str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); export const replaceAll = (originStr, replaceStr, newStr) => originStr.split(replaceStr).join(newStr); export const extractFirstNumberInString = str => { const matches = str.match(/\d+/g); return matches ? matches.map(Number)[0] : null; }; //# sourceMappingURL=text.js.map