Java String to convertStringArrayToFloatArray(String[] num)

Here you can find the source of convertStringArrayToFloatArray(String[] num)

Description

Convert array of strings to array of float

License

Apache License

Parameter

Parameter Description
num Array of string

Return

array of float

Declaration

private static float[] convertStringArrayToFloatArray(String[] num) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from  w w  w. j  ava  2s . com
     * Convert array of strings to array of float
     * @param num Array of string
     * @return array of float
     */
    private static float[] convertStringArrayToFloatArray(String[] num) {
        if (num != null) {
            float fArray[] = new float[num.length];
            for (int i = 0; i < num.length; i++) {
                fArray[i] = Float.parseFloat(num[i]);
            }
            return fArray;
        }
        return null;
    }
}

Related

  1. convertString(String s, Class cls)
  2. convertString(String strValue)
  3. convertString(String value, Class type)
  4. convertString2Bytes(String str)
  5. convertString2GSonString(String str)
  6. convertStringArrayToString(String[] a_asStrings, String a_sDelim)
  7. convertStringArrayToString(String[] value, String separator)
  8. convertStringFormat(String property)
  9. convertStringsToTextSet(String[] values)