@@ -210,7 +210,7 @@ public static Date parseDate(String string) {
210210
211211 if (str .startsWith (wcfJsonPrefix )) {
212212 String body = splitOnLast (splitOnFirst (str , '(' )[1 ], ')' )[0 ];
213- String unixTimeStr = splitOnLast (body .replace ('+' , '-' ), '-' )[0 ];
213+ String unixTimeStr = splitOnFirst (body .replace ('+' , '-' ), '-' , 1 )[0 ];
214214 long unixTime = Long .parseLong (unixTimeStr );
215215 return new Date (unixTime );
216216 }
@@ -369,32 +369,48 @@ else if (parts.length == 2)
369369
370370 /*String Utils*/
371371 public static String [] splitOnFirst (String strVal , char needle ) {
372+ return splitOnFirst (strVal , needle , 0 );
373+ }
374+
375+ public static String [] splitOnFirst (String strVal , char needle , int start ) {
372376 if (strVal == null ) return new String [0 ];
373- int pos = strVal .indexOf (needle );
377+ int pos = strVal .indexOf (needle , start );
374378 return pos == -1
375379 ? new String [] { strVal }
376380 : new String [] { strVal .substring (0 , pos ), strVal .substring (pos + 1 ) };
377381 }
378382
379383 public static String [] splitOnFirst (String strVal , String needle ) {
384+ return splitOnFirst (strVal , needle , 0 );
385+ }
386+
387+ public static String [] splitOnFirst (String strVal , String needle , int start ) {
380388 if (strVal == null ) return new String [0 ];
381- int pos = strVal .indexOf (needle );
389+ int pos = strVal .indexOf (needle , start );
382390 return pos == -1
383391 ? new String [] { strVal }
384392 : new String [] { strVal .substring (0 , pos ), strVal .substring (pos + needle .length ()) };
385393 }
386394
387395 public static String [] splitOnLast (String strVal , char needle ) {
396+ return splitOnLast (strVal , needle , strVal .length ());
397+ }
398+
399+ public static String [] splitOnLast (String strVal , char needle , int start ) {
388400 if (strVal == null ) return new String [0 ];
389- int pos = strVal .lastIndexOf (needle );
401+ int pos = strVal .lastIndexOf (needle , start );
390402 return pos == -1
391403 ? new String [] { strVal }
392404 : new String [] { strVal .substring (0 , pos ), strVal .substring (pos + 1 ) };
393405 }
394406
395407 public static String [] splitOnLast (String strVal , String needle ) {
408+ return splitOnLast (strVal , needle , strVal .length ());
409+ }
410+
411+ public static String [] splitOnLast (String strVal , String needle , int start ) {
396412 if (strVal == null ) return new String [0 ];
397- int pos = strVal .lastIndexOf (needle );
413+ int pos = strVal .lastIndexOf (needle , start );
398414 return pos == -1
399415 ? new String [] { strVal }
400416 : new String [] { strVal .substring (0 , pos ), strVal .substring (pos + needle .length ()) };
0 commit comments