DecimalFormatSymbols SetPatternSeparator() Example
Sets the character used to separate positive and negative subpatterns in a pattern.
DecimalFormatSymbolsclass SetPatternSeparator() method example. This example shows you how to use SetPatternSeparator() method.This method Sets the character used to separate positive and negative subpatterns in a pattern.
Here is the code:-
/**
* @Program that Sets the character used to separate positive and negative
* subpatterns in a pattern.
* SetPatternSeparator.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
public class SetPatternSeparator {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
//Gets the character used to separate positive and negative subpatterns in a pattern.
char c = dfs.getPatternSeparator();
System.out.println("The character used to separate positive and negative subpatterns is: " + c);
dfs.setPatternSeparator('%');
System.out.println("The character used to separate positive and negative subpatterns is: " +dfs.getPatternSeparator());
}
} |
Output of the program:-
The character used to separate positive and negative subpatterns is: ;
The character used to separate positive and negative subpatterns is: % |
|