Java String Sanitize sanitizeTypename(String name)

Here you can find the source of sanitizeTypename(String name)

Description

Rewrites a type name so that it can be executed in code.

License

Open Source License

Parameter

Parameter Description
name The type name.

Return

A sanitized version of the given type name.

Declaration

public static String sanitizeTypename(String name) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  www. j  a v a  2s. c o  m
     * Rewrites a type name so that it can be executed in code.
     * For example "Test.Foo foo" compiles but "Test$Foo foo",
     * the full typename, does not.
     * TODO: There must be a better way to do this through Eclipse.
     * @param name The type name.
     * @return A sanitized version of the given type name.
     */
    public static String sanitizeTypename(String name) {
        return name.replace('$', '.');
    }
}

Related

  1. sanitizeTimezones(String s)
  2. sanitizeTokenString(final String tokenString)
  3. sanitizeToLineFeed(CharSequence string)
  4. sanitizeToLong(String origMSISDN)
  5. sanitizeToString(String origMSISDN)
  6. sanitizeUnicode(String str)
  7. sanitizeUserEmail(String userEmail)
  8. sanitizeUserName(final String userName)
  9. sanitizeVersion(String inVer)