mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
added string util method for appending strings
This commit is contained in:
@ -176,6 +176,19 @@ public class StringUtils
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** safely appends a string to another, changing empty string if either value is null
|
||||
**
|
||||
*******************************************************************************/
|
||||
public static String safeAppend(String input, String contentToAppend)
|
||||
{
|
||||
input = input != null ? input : "";
|
||||
contentToAppend = contentToAppend != null ? contentToAppend : "";
|
||||
return input + contentToAppend;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** returns input if not null, or nullOutput if input == null (as in SQL NVL)
|
||||
**
|
||||
|
Reference in New Issue
Block a user