| Index: pkg/analyzer/lib/src/generated/java_core.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
|
| index b613897ec4da31e085236806eb5225e575f4b26e..2c992169b8f2aef58de3e2f64ade8fcfac90f026 100644
|
| --- a/pkg/analyzer/lib/src/generated/java_core.dart
|
| +++ b/pkg/analyzer/lib/src/generated/java_core.dart
|
| @@ -229,8 +229,55 @@ class PrintStringWriter extends PrintWriter {
|
| }
|
|
|
| class StringUtils {
|
| - static List<String> split(String s, [String pattern = '']) => s.split(pattern);
|
| - static String replace(String s, String from, String to) => s.replaceAll(from, to);
|
| + static String capitalize(String str) {
|
| + if (isEmpty(str)) {
|
| + return str;
|
| + }
|
| + return str.substring(0, 1).toUpperCase() + str.substring(1);
|
| + }
|
| +
|
| + static bool equals(String cs1, String cs2) {
|
| + if (cs1 == cs2) {
|
| + return true;
|
| + }
|
| + if (cs1 == null || cs2 == null) {
|
| + return false;
|
| + }
|
| + return cs1 == cs2;
|
| + }
|
| +
|
| + static bool isEmpty(String str) {
|
| + return str == null || str.isEmpty;
|
| + }
|
| +
|
| + static String join(Iterable iter, [String separator = ' ', int start = 0, int
|
| + end = -1]) {
|
| + if (start != 0) {
|
| + iter = iter.skip(start);
|
| + }
|
| + if (end != -1) {
|
| + iter = iter.take(end - start);
|
| + }
|
| + return iter.join(separator);
|
| + }
|
| +
|
| + static String remove(String str, String remove) {
|
| + if (isEmpty(str) || isEmpty(remove)) {
|
| + return str;
|
| + }
|
| + return str.replaceAll(remove, '');
|
| + }
|
| +
|
| + static String removeStart(String str, String remove) {
|
| + if (isEmpty(str) || isEmpty(remove)) {
|
| + return str;
|
| + }
|
| + if (str.startsWith(remove)) {
|
| + return str.substring(remove.length);
|
| + }
|
| + return str;
|
| + }
|
| +
|
| static String repeat(String s, int n) {
|
| StringBuffer sb = new StringBuffer();
|
| for (int i = 0; i < n; i++) {
|
| @@ -238,8 +285,14 @@ class StringUtils {
|
| }
|
| return sb.toString();
|
| }
|
| - static String join(Iterable iter, [String separator = " "]) {
|
| - return iter.join(separator);
|
| +
|
| + static List<String> split(String s, [String pattern = '']) {
|
| + return s.split(pattern);
|
| + }
|
| +
|
| + static List<String> splitByWholeSeparatorPreserveAllTokens(String s, String
|
| + pattern) {
|
| + return s.split(pattern);
|
| }
|
| }
|
|
|
|
|