-
Notifications
You must be signed in to change notification settings - Fork 1
/
string.js
67 lines (52 loc) · 1.21 KB
/
string.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
/**
* Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
* Author: lipengxiang
* Desc:
*/
var string = require('../browser/common/string');
/**
* @desc: 判断是否是手机号码.
* @return: boolean.
*/
exports.isPhoneMobile = string.isPhoneMobile;
/**
* @desc: 是否为空串.
* @return: boolean.
*/
exports.isEmpty = string.isEmpty;
/**
* @desc: 判断是否是email.
* @return: boolean.
*/
exports.isEmail = string.isEmail;
/**
* @desc: 判断是否是英文数字组合.
* @return: boolean.
*/
exports.isAlphaOrDigit = string.isAlphaOrDigit;
/**
* @desc: 判断是否是中文.
* @return: boolean.
*/
exports.isChinese = string.isChinese;
/**
* @desc: 获得字符串utf8编码后的字节长度.
* @return: u32.
*/
exports.getByteSize = string.getByteSize;
/**
* @desc: 替换字符串中所有的strSrc->strDest.
* @return: string.
*/
exports.replace = string.replace;
exports.utf8ToBytes = string.utf8ToBytes;
exports.bytesToUtf8 = string.bytesToUtf8;
exports.utf8Encode = string.utf8Encode;
exports.utf8Decode = string.utf8Decode;
/**
* @desc: 除去字符串两端空格.
* @return: string.
*/
exports.trim = string.trim;
exports.escapeHtml = string.escapeHtml;