at the text into a TextData. formattedtext=strfmt.formatText(str); // Now get the string back from the formatted text. str=strfmt.decodeText(formattedtext); } catch (UsageException e) { } When applying a format template in Java, you must escape the backslash character with another backslash for TOOL to correctly interpret the template. For example, you could do the following: TextData str = new TextData(); TextFormat strfmt =new TextFormat(); str.setValue("8005551234"); strfmt.setTemplate("\\(###\\) ###-####");
@author Tim
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.