摘要: import org.junit.Test; /** * @author CH * @create 2021 上午 11:23 */ public class IDEADebug { @Test public void testStringBuffer(){ String str = null; S 阅读全文
posted @ 2021-04-16 21:51 小白冲 阅读(106) 评论(0) 推荐(0) 编辑
摘要: /* 获取两个字符串中最大相同子串。比如:str1 = "abcwerthelloyuiodefabcdef";str2 = "cvhellobnm"提示:将短的那个串进行长度依次递减的子串与较长的串比较。 */ //前提:两个字符串中只有一个最大相同子串 import org.junit.Test 阅读全文
posted @ 2021-04-16 19:17 小白冲 阅读(512) 评论(0) 推荐(0) 编辑
摘要: /*获取一个字符串在另一个字符串中出现的次数。 比如:获取“ab”在 “abkkcadkabkebfkaabkskab” 中出现的次数*/ import org.testng.annotations.Test; /** * @author CH * @create 2021 上午 10:26 */ 阅读全文
posted @ 2021-04-16 11:04 小白冲 阅读(984) 评论(0) 推荐(2) 编辑
摘要: 将一个字符串进行反转:将字符串中指定部分进行反转。比如“abcdefg”反转为”abfedcg”方式一:转换为char[] public String reverse(String str,int startIndex,int endIndex){ if(str != null){ char[] a 阅读全文
posted @ 2021-04-16 00:40 小白冲 阅读(878) 评论(0) 推荐(1) 编辑