@@ -50,24 +50,18 @@ class PAIMON_EXPORT StringUtils {
5050 public:
5151 // / Replaces all occurrences of a string within another string.
5252 // /
53- // / A `null` reference passed to this method is a no-op.
54- // /
5553 // / <pre>
56- // / StringUtils::Replace(null, *, *) = null
5754 // / StringUtils::Replace("", *, *) = ""
58- // / StringUtils::Replace("any", null, *) = "any"
59- // / StringUtils::Replace("any", *, null) = "any"
6055 // / StringUtils::Replace("any", "", *) = "any"
61- // / StringUtils::Replace("aba", "a", null) = "aba"
6256 // / StringUtils::Replace("aba", "a", "") = "b"
6357 // / StringUtils::Replace("aba", "a", "z") = "zbz"
6458 // / </pre>
6559 // /
6660 // / @see #replace(string text, string search_string, string replacement, int max)
67- // / @param text text to search and replace in, may be null
68- // / @param search_string the String to search for, may be null
69- // / @param replacement the String to replace it with, may be null
70- // / @return the text with any replacements processed, `null` if null string input
61+ // / @param text text to search and replace in
62+ // / @param search_string the String to search for
63+ // / @param replacement the String to replace it with
64+ // / @return the text with any replacements processed
7165 static std::string Replace (const std::string& text, const std::string& search_string,
7266 const std::string& replacement) {
7367 return Replace (text, search_string, replacement, -1 );
@@ -76,28 +70,22 @@ class PAIMON_EXPORT StringUtils {
7670 // / Replaces a String with another String inside a larger String, for the first `max` values of
7771 // / the search String.
7872 // /
79- // / A `null` reference passed to this method is a no-op.
80- // /
8173 // / <pre>
82- // / StringUtils::Replace(null, *, *, *) = null
8374 // / StringUtils::Replace("", *, *, *) = ""
84- // / StringUtils::Replace("any", null, *, *) = "any"
85- // / StringUtils::Replace("any", *, null, *) = "any"
8675 // / StringUtils::Replace("any", "", *, *) = "any"
8776 // / StringUtils::Replace("any", *, *, 0) = "any"
88- // / StringUtils::Replace("abaa", "a", null, -1) = "abaa"
8977 // / StringUtils::Replace("abaa", "a", "", -1) = "b"
9078 // / StringUtils::Replace("abaa", "a", "z", 0) = "abaa"
9179 // / StringUtils::Replace("abaa", "a", "z", 1) = "zbaa"
9280 // / StringUtils::Replace("abaa", "a", "z", 2) = "zbza"
9381 // / StringUtils::Replace("abaa", "a", "z", -1) = "zbzz"
9482 // / </pre>
9583 // /
96- // / @param text text to search and replace in, may be null
97- // / @param search_string the String to search for, may be null
98- // / @param replacement the String to replace it with, may be null
84+ // / @param text text to search and replace in
85+ // / @param search_string the String to search for
86+ // / @param replacement the String to replace it with
9987 // / @param max maximum number of values to replace, or `-1` if no maximum
100- // / @return the text with any replacements processed, `null` if null string input
88+ // / @return the text with any replacements processed
10189 static std::string Replace (const std::string& text, const std::string& search_string,
10290 const std::string& replacement, int32_t max);
10391
@@ -115,6 +103,9 @@ class PAIMON_EXPORT StringUtils {
115103 static std::string ToLowerCase (const std::string& str);
116104 static std::string ToUpperCase (const std::string& str);
117105
106+ // / Compares two strings using ASCII case folding.
107+ static bool EqualsIgnoreCase (const std::string& left, const std::string& right);
108+
118109 template <typename T>
119110 static std::string VectorToString (const std::vector<T>& vec) {
120111 std::vector<std::string> strs;
0 commit comments