Project

General

Profile

« Previous | Next » 

Revision 3f4c93b7

Added by Andreas Müller over 12 years ago

remove surrounding brackets

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/CdmUtils.java
434 434
		}
435 435
		return string;
436 436
	}
437

  
438
	/**
439
	 * Returns surrounding brackets "(",")". Trim the string if necessary.
440
	 * @param text
441
	 * @return
442
	 */
443
	public static String removeBrackets(String text) {
444
		if (text == null){
445
			return null;
446
		}
447
		text = text.trim();
448
		if (text.matches("^\\(.*\\)$")){
449
			text = text.substring(1, text.length() -1);
450
		}
451
		return text;
452
	}
437 453
}

Also available in: Unified diff