litesoft
Diff Revisions
905
vs
906
for /trunk/Java/core/Anywhere/src/org/litesoft/core/typeutils/Strings.java
|
@@ -269,6 +269,18 @@ |
269 |
269 |
|
return ((pStringToCheck == null) || (pStringToCheck.trim().length() == 0)); |
270 |
270 |
|
} |
271 |
271 |
|
|
|
272 |
+ |
/** |
|
273 |
+ |
* Returns a substring of the specified text. |
|
274 |
+ |
* |
|
275 |
+ |
* @param pEnd The End index of the substring. If negative, the index used will be "text.length() + End". |
|
276 |
+ |
*/ |
|
277 |
+ |
public static String substring( String pText, int pStart, int pEnd ) |
|
278 |
+ |
{ |
|
279 |
+ |
assertNotNullNotEmpty( "text", pText ); |
|
280 |
+ |
Integers.assertNonNegative( "start", pStart ); |
|
281 |
+ |
return pText.substring( pStart, (pEnd >= 0) ? pEnd : pText.length() + pEnd ); |
|
282 |
+ |
} |
|
283 |
+ |
|
272 |
284 |
|
public static String trimLeadingSpaces( String pStr ) |
273 |
285 |
|
{ |
274 |
286 |
|
if ( (pStr == null) || !pStr.startsWith( " " ) ) |