正在显示
2 个修改的文件
包含
20 行增加
和
0 行删除
| @@ -30,6 +30,11 @@ | @@ -30,6 +30,11 @@ | ||
| 30 | <version>2.0.8</version> | 30 | <version>2.0.8</version> |
| 31 | <scope>test</scope> | 31 | <scope>test</scope> |
| 32 | </dependency> | 32 | </dependency> |
| 33 | + <dependency> | ||
| 34 | + <groupId>org.jetbrains</groupId> | ||
| 35 | + <artifactId>annotations</artifactId> | ||
| 36 | + <version>RELEASE</version> | ||
| 37 | + </dependency> | ||
| 33 | </dependencies> | 38 | </dependencies> |
| 34 | 39 | ||
| 35 | <build> | 40 | <build> |
| 1 | +package com.tianbo.util.String; | ||
| 2 | + | ||
| 3 | +public class StringUtil { | ||
| 4 | + /** | ||
| 5 | + * | ||
| 6 | + * @param src 原字符 | ||
| 7 | + * @param dec 插入字符 | ||
| 8 | + * @param position 插入位置 | ||
| 9 | + * @return | ||
| 10 | + */ | ||
| 11 | + public static String insertStringInParticularPosition(String src, String dec, int position){ | ||
| 12 | + StringBuffer stringBuffer = new StringBuffer(src); | ||
| 13 | + return stringBuffer.insert(position, dec).toString(); | ||
| 14 | + } | ||
| 15 | +} |
-
请 注册 或 登录 后发表评论