字符串去重
来源:互联网 发布:淘宝店铺封了直通车 编辑:程序博客网 时间:2024/05/01 05:18
public class StringRepetition {
public static void main(String[] args) {
System.out.println(withoutRepetion("aaabbc"));
}
public static String withoutRepetion(String s){
if(null == s || s.trim().length() == 0){
return null;
}
String str = "";
for(int i = 0; i < s.length(); i++){
if(str.indexOf(s.substring(i, i+1)) < 0){
str += s.substring(i, i+1);
}
}
return str;
}
}
public static void main(String[] args) {
System.out.println(withoutRepetion("aaabbc"));
}
public static String withoutRepetion(String s){
if(null == s || s.trim().length() == 0){
return null;
}
String str = "";
for(int i = 0; i < s.length(); i++){
if(str.indexOf(s.substring(i, i+1)) < 0){
str += s.substring(i, i+1);
}
}
return str;
}
}
0 0
- 字符串去重
- 字符串去重
- java 字符串去重
- js 字符串去重
- 字符串去重/C#
- 数字、字符串去重
- 字符串去重
- TreeSet去重字符串
- 字符串去重
- 字符串数组去重
- Java字符串去重
- 字符串数组去重
- 字符串去重
- js字符串去重
- 字符串去重 java
- 字符串去重
- 字符串右旋 、 字符串去重
- C++ 字符串数组去重
- 项目实例:WebService axis1.4高级编程(服务端、客户端)
- Java多线程Sample1
- Android SDK Manager 详细讲解
- J2EE——你知道多少?
- 软工视频总结--定义
- 字符串去重
- 使用IAR开发LPCXpresso54608入门
- HTTP协议
- lol-登陆英雄联盟出错
- 基于URL的抓取搜索引擎搜索结果数目的Java小工具源码
- 第一次作业
- ubuntu server 14.04.5版本下载
- 【opencv学习笔记】1、opencv缩放图片
- 同步和异步