1 42 43 package org.jfree.util; 44 45 50 public class StringUtils { 51 52 55 private StringUtils() { 56 } 57 58 66 public static boolean startsWithIgnoreCase(final String base, final String start) { 67 if (base.length() < start.length()) { 68 return false; 69 } 70 return base.regionMatches(true, 0, start, 0, start.length()); 71 } 72 73 81 public static boolean endsWithIgnoreCase(final String base, final String end) { 82 if (base.length() < end.length()) { 83 return false; 84 } 85 return base.regionMatches(true, base.length() - end.length(), end, 0, end.length()); 86 } 87 88 94 public static String getLineSeparator() { 95 try { 96 return System.getProperty("line.separator", "\n"); 97 } 98 catch (Exception e) { 99 return "\n"; 100 } 101 } 102 103 104 } 105 | Popular Tags |