diff options
author | Erlang/OTP <[email protected]> | 2017-06-30 15:20:47 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2017-06-30 15:20:47 +0200 |
commit | c73d8d9feb9b0ebc988bd44ed340988df12c53b2 (patch) | |
tree | 46e5e6ab0a675d5152fae9338d181896a1d862c1 /lib/stdlib/src | |
parent | 826cdb6f2d4c880fd903e9b83b355386be336ded (diff) | |
parent | 986b720d85d5cabf4c8f68a5112bdeeb225c147b (diff) | |
download | otp-c73d8d9feb9b0ebc988bd44ed340988df12c53b2.tar.gz otp-c73d8d9feb9b0ebc988bd44ed340988df12c53b2.tar.bz2 otp-c73d8d9feb9b0ebc988bd44ed340988df12c53b2.zip |
Merge branch 'dgud/stdlib/string-len-compat/OTP-14487' into maint-20
* dgud/stdlib/string-len-compat/OTP-14487:
Fix old length usage in string
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/string.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/stdlib/src/string.erl b/lib/stdlib/src/string.erl index 6f7009b5d9..4972da297d 100644 --- a/lib/stdlib/src/string.erl +++ b/lib/stdlib/src/string.erl @@ -384,7 +384,7 @@ to_float(String) -> end. to_number(String, Number, Rest, List, _Tail) when is_binary(String) -> - BSz = length(List)-length(Rest), + BSz = erlang:length(List)-erlang:length(Rest), <<_:BSz/binary, Cont/binary>> = String, {Number, Cont}; to_number(_, Number, Rest, _, Tail) -> @@ -1344,7 +1344,7 @@ bin_search_str(Bin0, Start, Cont, [CP|_]=SearchCPs) -> String :: string(), Length :: non_neg_integer(). -len(S) -> length(S). +len(S) -> erlang:length(S). %% equal(String1, String2) %% Test if 2 strings are equal. @@ -1689,7 +1689,7 @@ left(String, Len) when is_integer(Len) -> left(String, Len, $\s). Character :: char(). left(String, Len, Char) when is_integer(Char) -> - Slen = length(String), + Slen = erlang:length(String), if Slen > Len -> substr(String, 1, Len); Slen < Len -> l_pad(String, Len-Slen, Char); @@ -1714,7 +1714,7 @@ right(String, Len) when is_integer(Len) -> right(String, Len, $\s). Character :: char(). right(String, Len, Char) when is_integer(Char) -> - Slen = length(String), + Slen = erlang:length(String), if Slen > Len -> substr(String, Slen-Len+1); Slen < Len -> r_pad(String, Len-Slen, Char); @@ -1741,7 +1741,7 @@ centre(String, Len) when is_integer(Len) -> centre(String, Len, $\s). centre(String, 0, Char) when is_list(String), is_integer(Char) -> []; % Strange cases to centre string centre(String, Len, Char) when is_integer(Char) -> - Slen = length(String), + Slen = erlang:length(String), if Slen > Len -> substr(String, (Slen-Len) div 2 + 1, Len); Slen < Len -> |