Here you can find the source of extractClassNameFromArray(final String arrayName)
Parameter | Description |
---|---|
arrayName | The array declaration |
public static String extractClassNameFromArray(final String arrayName)
//package com.java2s; /**/*www .j a va 2 s.c o m*/ * This file is part of the Harmony package. * * (c) Mickael Gaillard <mickael.gaillard@tactfactory.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ public class Main { /** Extract a class name from an array. * @param arrayName The array declaration * @return The name of the class */ public static String extractClassNameFromArray(final String arrayName) { String cName = arrayName; if (arrayName.contains("<")) { cName = arrayName.substring(arrayName.indexOf('<') + 1, arrayName.indexOf('>')); } else if (arrayName.contains("[]")) { cName = arrayName.substring(0, arrayName.indexOf('[')); } return cName; } }