Java Array Convert to arrayToOneLineSpaceDelimitedString(Object obj[])

Here you can find the source of arrayToOneLineSpaceDelimitedString(Object obj[])

Description

array To One Line Space Delimited String

License

Apache License

Declaration

public static String arrayToOneLineSpaceDelimitedString(Object obj[]) 

Method Source Code

//package com.java2s;
/*/*from   w  w w  . j ava2s. co  m*/
 * Copyright 2009 the original author or authors.
 * Copyright 2009 SorcerSoft.org.
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    public static String arrayToOneLineSpaceDelimitedString(Object obj[]) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < obj.length; i++) {
            sb.append(obj[i] + " ");
        }
        sb.append("\n");
        return sb.toString();
    }
}

Related

  1. arrayToJson(int[] x)
  2. arrayToLine(Object[] source)
  3. arrayToLines(String[] lines)
  4. arrayToLowercase(String[] array)
  5. arrayToMatlabStringArray(double da[])
  6. arrayToQueryString(String key, Object[] arr)
  7. arrayToSeparatedString(final String[] strings, final String separator)
  8. arrayToSqlInList(String... values)
  9. arrayToSv(String as[], String s)