Java String Array Merge mergeString(String[] str1, String[] str2)

Here you can find the source of mergeString(String[] str1, String[] str2)

Description

merge String

License

Apache License

Declaration

public static String[] mergeString(String[] str1, String[] str2) 

Method Source Code

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

public class Main {
    public static String[] mergeString(String[] str1, String[] str2) {
        String[] merged = new String[str1.length + str2.length];
        for (int i = 0; i < str1.length; i++) {
            merged[i] = str1[i];//  w w w.j  a  va2s  .  c  o  m
        }
        for (int i = 0; i < str2.length; i++) {
            merged[i + str1.length] = str2[0];
        }
        return merged;
    }
}

Related

  1. merge(T[] arr0, String delimiter)
  2. mergeInts(int[] values, String delimiter)
  3. mergeJoin(String sep, String[] a1, String[] a2)
  4. mergeJoin(String sep, String[] a1, String[] a2)
  5. mergeString(String currentValue, String newValue)
  6. mergeStrings(Object... strings)
  7. mergeStrings(String s1, String s2)
  8. mergeStrings(String[] str1, String str1Tag, String[] str2)
  9. mergeStringsFormatted(String[] strings, String spacer)