Java Array arrayOffloatCoordsAsCSStrings(float[] ar)

Here you can find the source of arrayOffloatCoordsAsCSStrings(float[] ar)

Description

array Offloat Coords As CS Strings

License

Open Source License

Declaration

public static String arrayOffloatCoordsAsCSStrings(float[] ar) 

Method Source Code

//package com.java2s;

public class Main {
    public static String arrayOffloatCoordsAsCSStrings(float[] ar) {
        String res = "";
        if (ar.length % 2 == 0) {
            for (int i = 0; i < ar.length - 2;) {
                res += Float.toString(ar[i]) + "," + Float.toString(ar[i + 1]) + ";";
                i += 2;/*from  w  w w  .j  ava2 s  .c  o  m*/
            }
            res += Float.toString(ar[ar.length - 2]) + "," + Float.toString(ar[ar.length - 1]);
        }
        return res;
    }
}

Related

  1. arrayMember(String[] array, String member)
  2. arrayMinus(double[] w, double[] v)
  3. arrayNotEmpty(T[] objects, String message)
  4. arrayOfClassType(T... array)
  5. arrayOffloatAsCSStrings(float[] ar)
  6. arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)
  7. arrayPrint(T[] arr)
  8. arrayPrint(T[] x)
  9. arrayPush(String[] array, String push)