首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

如何避免这个字符串?

2012-02-20 
如何处理这个字符串???????????我想处理一个字符串如:ou公司,ou中国我想只得到“公司,中国”这个串,也就

如何处理这个字符串???????????
我想处理一个字符串如:ou=公司,ou=中国;我想只得到“公司,中国”这个串,也就是得到两个等号后面的字符组成的串,用java怎么处理,还请赐教!!

[解决办法]
Properties properties = new Properties();
properties.load(new FileInputStream(file));
String com=properties.get( "com ");
a.properties文本中
ou=公司,ou=中国这样写即可
[解决办法]
public String getContent(String s){
String content= " ";
if(s.contains( "= ")){
String[] str=s.split( "= ");
content=str[1];
}
return content;
}
[解决办法]
可以自己写个方法,在字符串中删除所有 "ou= "
[解决办法]
YES
[解决办法]
象是操作ldap,看看JNDI吧
[解决办法]
String t= "ou=中国 ";
t=t.substring(3);

热点排行
Bad Request.