mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
Hellohao图床6-12更新
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package cn.hellohao.utils;
|
||||
|
||||
public class SetText {
|
||||
public static String getSubString(String text, String left, String right) {
|
||||
String result = "";
|
||||
int zLen;
|
||||
if (left == null || left.isEmpty()) {
|
||||
zLen = 0;
|
||||
} else {
|
||||
zLen = text.indexOf(left);
|
||||
if (zLen > -1) {
|
||||
zLen += left.length();
|
||||
} else {
|
||||
zLen = 0;
|
||||
}
|
||||
}
|
||||
int yLen = text.indexOf(right, zLen);
|
||||
if (yLen < 0 || right == null || right.isEmpty()) {
|
||||
yLen = text.length();
|
||||
}
|
||||
result = text.substring(zLen, yLen);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user