mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Update fastReplace (return null if source string is null)
This commit is contained in:
@@ -269,6 +269,9 @@ public class TextUtil {
|
|||||||
|
|
||||||
//fast Replace
|
//fast Replace
|
||||||
public static String fastReplace( String str, String target, String replacement ) {
|
public static String fastReplace( String str, String target, String replacement ) {
|
||||||
|
if (str == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
int targetLength = target.length();
|
int targetLength = target.length();
|
||||||
if( targetLength == 0 ) {
|
if( targetLength == 0 ) {
|
||||||
return str;
|
return str;
|
||||||
|
|||||||
Reference in New Issue
Block a user