Join string from soapUI : String Join « Data Type « Java Tutorial






/*
 *  soapUI, copyright (C) 2004-2009 eviware.com 
 *
 *  soapUI is free software; you can redistribute it and/or modify it under the 
 *  terms of version 2.1 of the GNU Lesser General Public License as published by 
 *  the Free Software Foundation.
 *
 *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
 *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 *  See the GNU Lesser General Public License for more details at gnu.org.
 */


public class Utils {
  
  public static String join( String[] array, String separator )
  {
    StringBuffer buf = new StringBuffer();
    for( int i = 0; i < array.length; i++ )
    {
      if( i > 0 )
        buf.append( separator );
      buf.append( array[i] );
    }
    return buf.toString();
  }
}








2.33.String Join
2.33.1.Join String
2.33.2.Join an array of strings into one delimited string
2.33.3.Join string from soapUI
2.33.4.Joins array elements into a single String without specifying the start index and end index.
2.33.5.Joins array elements into a single String: specify the start index and end index.
2.33.6.Joins array elements: Null objects or empty strings within the array are represented by empty strings.
2.33.7.Joins the elements of Collection into a single String with string separator.
2.33.8.Joins the elements of the provided Collection into a single String containing the provided elements.
2.33.9.Joins the elements of the provided Iterator into a single String containing the provided elements.
2.33.10.Joins the elements of the provided array into a single String containing the provided list of elements.
2.33.11.Overlays part of a String with another String.