Here you can find the source of arrayTypeToZeroLengthArray(String arrayType)
Parameter | Description |
---|---|
arrayType | a parameter |
public static String arrayTypeToZeroLengthArray(String arrayType)
//package com.java2s; //License from project: Apache License public class Main { /**/*from ww w . ja v a2s . c o m*/ * * @param arrayType * @return */ public static String arrayTypeToZeroLengthArray(String arrayType) { int o = arrayType.indexOf("[]"); if (o < 0) { throw new IllegalStateException("Not a array type"); } StringBuffer sb = new StringBuffer(); sb.append(arrayType.substring(0, o)).append("[0]"); return sb.toString(); } }