agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/util/ServiceUtils.java
/**
	 * Formats a 10 digit phone number into (###) ###-#### format
	 * 
	 * @param phone the phone number to format
	 * @return formatted phone number string
	 */
Formats a 10 digit phone number into (###)  format

@param phone the phone number to format
@return formatted phone number string
Formats a 10 digit phone number into ( ### ) format @param phone the phone number to format @return formatted phone number string
public static String formatPhoneNumber(String phone) 
	{	
		if (StringUtils.isEmpty(phone)) { 
			return null;
		}
		else 
		{
			phone = phone.replaceAll("[^\\d.]", "");
			return String.format("(%s) %s-%s", 
					phone.substring(0, 3), 
					phone.substring(3, 6), 
					phone.substring(6, 10));
		}
	}
public static String formatPhoneNumber ( String phone ) { if ( StringUtils . isEmpty ( phone ) ) { return null ; } else { phone = phone . replaceAll ( "[^\\d.]" , "" ) ; return String . format ( "(%s) %s-%s" , phone . substring ( 0 , 3 ) , phone . substring ( 3 , 6 ) , phone . substring ( 6 , 10 ) ) ; } }
Formats a 10 digit phone number into (###) ###-#### format
Formats a 10 digit phone number into ( ### ) ### - #### format