Files
18xchat/assets/Scripts/chat18x/utils/tools.ts
T
2025-08-11 16:08:59 +08:00

12 lines
293 B
TypeScript

export default class Tools {
private static chineseReg: RegExp;
public static IsChinese(s: string): boolean {
if (!this.chineseReg) {
this.chineseReg = new RegExp("^[\u4E00-\u9FFFF]+$");
}
if (!this.chineseReg.test(s)) {
return false;
} else return true;
}
}