Java CharsToNameCanonicalizer-class And Method Code Example

Here is an example of how to use the CharsToNameCanonicalizer class from the package in Java to canonicalize a string:


public class Main {
    public static void main(String[] args) {
        String input = "example string to canonicalize";
        CharsToNameCanonicalizer ctnc = new CharsToNameCanonicalizer();
        String output = ctnc.canonicalize(input);

In this example, the input string "example string to canonicalize" is passed to the canonicalize() method of the CharsToNameCanonicalizer object, which returns the canonicalized version of the string.

Please note that, this class has been removed from library, it was present in version 2.6, But as of latest version it has been removed, you can use other libraries like Guava library's to achieve similar functionality.