AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
静态 Public 成员函数 | 所有成员列表
com.ab.util.AbStrUtil类 参考

静态 Public 成员函数

static String parseEmpty (String str)
 
static boolean isEmpty (String str)
 
static int chineseLength (String str)
 
static int strLength (String str)
 
static int subStringLength (String str, int maxL)
 
static Boolean isMobileNo (String str)
 
static Boolean isNumberLetter (String str)
 
static Boolean isNumber (String str)
 
static Boolean isEmail (String str)
 
static Boolean isChinese (String str)
 
static Boolean isContainChinese (String str)
 
static String convertStreamToString (InputStream is)
 
static String dateTimeFormat (String dateTime)
 
static String strFormat2 (String str)
 
static String cutString (String str, int length)
 
static String cutString (String str, int length, String dot)
 
static String cutStringFromChar (String str1, String str2, int offset)
 
static int strlen (String str, String charset)
 
static String getSizeDesc (long size)
 
static long ip2int (String ip)
 
static void main (String[] args)
 

详细描述

© 2012 amsoft.cn 名称:AbStrUtil.java 描述:字符串处理类.

作者
还如一梦中
版本
v1.0
日期
:2013-01-17 下午11:52:13

成员函数说明

static int com.ab.util.AbStrUtil.chineseLength ( String  str)
inlinestatic

获取字符串中文字符的长度(每个中文算2个字符).

参数
str指定的字符串
返回
中文字符的长度
static String com.ab.util.AbStrUtil.convertStreamToString ( InputStream  is)
inlinestatic

描述:从输入流中获得String.

参数
is输入流
返回
获得的String
static String com.ab.util.AbStrUtil.cutString ( String  str,
int  length 
)
inlinestatic

描述:截取字符串到指定字节长度.

参数
strthe str
length指定字节长度
返回
截取后的字符串
static String com.ab.util.AbStrUtil.cutString ( String  str,
int  length,
String  dot 
)
inlinestatic

描述:截取字符串到指定字节长度.

参数
str文本
length字节长度
dot省略符号
返回
截取后的字符串
static String com.ab.util.AbStrUtil.cutStringFromChar ( String  str1,
String  str2,
int  offset 
)
inlinestatic

描述:截取字符串从第一个指定字符.

参数
str1原文本
str2指定字符
offset偏移的索引
返回
截取后的字符串
static String com.ab.util.AbStrUtil.dateTimeFormat ( String  dateTime)
inlinestatic

描述:标准化日期时间类型的数据,不足两位的补0.

参数
dateTime预格式的时间字符串,如:2012-3-2 12:2:20
返回
String 格式化好的时间字符串,如:2012-03-20 12:02:20
static String com.ab.util.AbStrUtil.getSizeDesc ( long  size)
inlinestatic

获取大小的描述.

参数
size字节个数
返回
大小的描述
static long com.ab.util.AbStrUtil.ip2int ( String  ip)
inlinestatic

描述:ip地址转换为10进制数.

参数
ipthe ip
返回
the long
static Boolean com.ab.util.AbStrUtil.isChinese ( String  str)
inlinestatic

描述:是否是中文.

参数
str指定的字符串
返回
是否是中文:是为true,否则false
static Boolean com.ab.util.AbStrUtil.isContainChinese ( String  str)
inlinestatic

描述:是否包含中文.

参数
str指定的字符串
返回
是否包含中文:是为true,否则false
static Boolean com.ab.util.AbStrUtil.isEmail ( String  str)
inlinestatic

描述:是否是邮箱.

参数
str指定的字符串
返回
是否是邮箱:是为true,否则false
static boolean com.ab.util.AbStrUtil.isEmpty ( String  str)
inlinestatic

描述:判断一个字符串是否为null或空值.

参数
str指定的字符串
返回
true or false
static Boolean com.ab.util.AbStrUtil.isMobileNo ( String  str)
inlinestatic

描述:手机号格式验证.

参数
str指定的手机号码字符串
返回
是否为手机号码格式:是为true,否则false
static Boolean com.ab.util.AbStrUtil.isNumber ( String  str)
inlinestatic

描述:是否只是数字.

参数
str指定的字符串
返回
是否只是数字:是为true,否则false
static Boolean com.ab.util.AbStrUtil.isNumberLetter ( String  str)
inlinestatic

描述:是否只是字母和数字.

参数
str指定的字符串
返回
是否只是字母和数字:是为true,否则false
static void com.ab.util.AbStrUtil.main ( String[]  args)
inlinestatic

The main method.

参数
argsthe arguments
static String com.ab.util.AbStrUtil.parseEmpty ( String  str)
inlinestatic

描述:将null转化为“”.

参数
str指定的字符串
返回
字符串的String类型
static String com.ab.util.AbStrUtil.strFormat2 ( String  str)
inlinestatic

描述:不足2个字符的在前面补“0”.

参数
str指定的字符串
返回
至少2个字符的字符串
static int com.ab.util.AbStrUtil.strlen ( String  str,
String  charset 
)
inlinestatic

描述:获取字节长度.

参数
str文本
charset字符集(GBK)
返回
the int
static int com.ab.util.AbStrUtil.strLength ( String  str)
inlinestatic

描述:获取字符串的长度.

参数
str指定的字符串
返回
字符串的长度(中文字符计2个)
static int com.ab.util.AbStrUtil.subStringLength ( String  str,
int  maxL 
)
inlinestatic

描述:获取指定长度的字符所在位置.

参数
str指定的字符串
maxL要取到的长度(字符长度,中文字符计2个)
返回
字符的所在位置

该类的文档由以下文件生成: