1 61 package org.apache.commons.cli; 62 63 68 class Util { 69 70 78 static String stripLeadingHyphens(String str) 79 { 80 if (str.startsWith("--")) 81 { 82 return str.substring(2, str.length()); 83 } 84 else if (str.startsWith("-")) 85 { 86 return str.substring(1, str.length()); 87 } 88 89 return str; 90 } 91 92 101 static String stripLeadingAndTrailingQuotes(String str) 102 { 103 if (str.startsWith("\"")) { 104 str = str.substring(1, str.length()); 105 } 106 if (str.endsWith("\"")) { 107 str = str.substring(0, str.length()-1); 108 } 109 return str; 110 } 111 } | Popular Tags |