Java Array arrayTypeToZeroLengthArray(String arrayType)

Here you can find the source of arrayTypeToZeroLengthArray(String arrayType)

Description

array Type To Zero Length Array

License

Apache License

Parameter

Parameter Description
arrayType a parameter

Declaration

public static String arrayTypeToZeroLengthArray(String arrayType) 

Method Source Code

//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();
    }
}

Related

  1. arrayString(double[] test)
  2. arrayString(int[] data)
  3. arrayStringR(double[] data)
  4. arrayTransfer(int[] ids)
  5. arrayType(String type)
  6. arrayUnEscape(String string)
  7. arrayValid(Object[] objects)
  8. arrayValidLength(int[] array)
  9. arrayWithoutFirstElement(final String[] array)