Here you can find the source of toClassName(String className)
Parameter | Description |
---|---|
className | to replace backslashes |
public static String toClassName(String className)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w . j a va 2s. c o m*/ * Converts a given string to a valid className * (replaces backslashes with .) * * @param className to replace backslashes * @return the valid version of className */ public static String toClassName(String className) { if (null == className || className.isEmpty()) { return className; } if (className.startsWith(".") || className.startsWith("/")) { className = className.substring(1); } return className.replace("/", ".").replace("\\", "."); } }