Java String Array Merge mergeString(String currentValue, String newValue)

Here you can find the source of mergeString(String currentValue, String newValue)

Description

merge String

License

Open Source License

Declaration

public static String mergeString(String currentValue, String newValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String mergeString(String currentValue, String newValue) {
        if (currentValue == null || currentValue.length() == 0)
            return newValue;
        if (newValue == null || newValue.length() == 0)
            return currentValue;
        if (newValue.length() > currentValue.length())
            return newValue;
        return currentValue;
    }//from   w  ww . j  a  v  a2  s .c o m
}

Related

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