@@ -261,7 +261,7 @@ defmodule String do
261
261
262
262
"""
263
263
@ spec split ( t ) :: [ t ]
264
- defdelegate split ( binary ) , to: String.Unicode
264
+ defdelegate split ( binary ) , to: String.Break
265
265
266
266
@ doc ~S"""
267
267
Divides a string into substrings based on a pattern.
@@ -449,7 +449,7 @@ defmodule String do
449
449
end
450
450
451
451
defp do_split_at ( string , position ) do
452
- { byte_size , rest } = String.Graphemes . split_at ( string , position )
452
+ { byte_size , rest } = String.Unicode . split_at ( string , position )
453
453
{ binary_part ( string , 0 , byte_size ) , rest || "" }
454
454
end
455
455
@@ -529,7 +529,7 @@ defmodule String do
529
529
530
530
"""
531
531
@ spec upcase ( t ) :: t
532
- defdelegate upcase ( binary ) , to: String.Unicode
532
+ defdelegate upcase ( binary ) , to: String.Casing
533
533
534
534
@ doc """
535
535
Converts all characters in the given string to lowercase.
@@ -547,7 +547,7 @@ defmodule String do
547
547
548
548
"""
549
549
@ spec downcase ( t ) :: t
550
- defdelegate downcase ( binary ) , to: String.Unicode
550
+ defdelegate downcase ( binary ) , to: String.Casing
551
551
552
552
@ doc """
553
553
Converts the first character in the given string to
@@ -572,7 +572,7 @@ defmodule String do
572
572
"""
573
573
@ spec capitalize ( t ) :: t
574
574
def capitalize ( string ) when is_binary ( string ) do
575
- { char , rest } = String.Unicode . titlecase_once ( string )
575
+ { char , rest } = String.Casing . titlecase_once ( string )
576
576
char <> downcase ( rest )
577
577
end
578
578
@@ -587,7 +587,7 @@ defmodule String do
587
587
588
588
"""
589
589
@ spec rstrip ( t ) :: t
590
- defdelegate rstrip ( binary ) , to: String.Unicode
590
+ defdelegate rstrip ( binary ) , to: String.Break
591
591
592
592
@ doc """
593
593
Returns a string where all trailing `char`s have been removed.
@@ -759,7 +759,7 @@ defmodule String do
759
759
"abc "
760
760
761
761
"""
762
- defdelegate lstrip ( binary ) , to: String.Unicode
762
+ defdelegate lstrip ( binary ) , to: String.Break
763
763
764
764
@ doc """
765
765
Returns a string where all leading `char`s have been removed.
@@ -1184,7 +1184,7 @@ defmodule String do
1184
1184
1185
1185
"""
1186
1186
@ spec graphemes ( t ) :: [ grapheme ]
1187
- defdelegate graphemes ( string ) , to: String.Graphemes
1187
+ defdelegate graphemes ( string ) , to: String.Unicode
1188
1188
1189
1189
@ compile { :inline , next_grapheme: 1 , next_grapheme_size: 1 }
1190
1190
@@ -1223,7 +1223,7 @@ defmodule String do
1223
1223
1224
1224
"""
1225
1225
@ spec next_grapheme_size ( t ) :: { pos_integer , t } | nil
1226
- defdelegate next_grapheme_size ( string ) , to: String.Graphemes
1226
+ defdelegate next_grapheme_size ( string ) , to: String.Unicode
1227
1227
1228
1228
@ doc """
1229
1229
Returns the first grapheme from a utf8 string,
@@ -1283,7 +1283,7 @@ defmodule String do
1283
1283
1284
1284
"""
1285
1285
@ spec length ( t ) :: non_neg_integer
1286
- defdelegate length ( string ) , to: String.Graphemes
1286
+ defdelegate length ( string ) , to: String.Unicode
1287
1287
1288
1288
@ doc """
1289
1289
Returns the grapheme at the `position` of the given utf8 `string`.
@@ -1322,7 +1322,7 @@ defmodule String do
1322
1322
end
1323
1323
1324
1324
defp do_at ( string , position ) do
1325
- case String.Graphemes . split_at ( string , position ) do
1325
+ case String.Unicode . split_at ( string , position ) do
1326
1326
{ _ , nil } -> nil
1327
1327
{ _ , rest } -> first ( rest )
1328
1328
end
@@ -1372,10 +1372,10 @@ defmodule String do
1372
1372
end
1373
1373
1374
1374
def slice ( string , start , len ) when start >= 0 and len >= 0 do
1375
- case String.Graphemes . split_at ( string , start ) do
1375
+ case String.Unicode . split_at ( string , start ) do
1376
1376
{ _ , nil } -> ""
1377
1377
{ start_bytes , rest } ->
1378
- { len_bytes , _ } = String.Graphemes . split_at ( rest , len )
1378
+ { len_bytes , _ } = String.Unicode . split_at ( rest , len )
1379
1379
binary_part ( string , start_bytes , len_bytes )
1380
1380
end
1381
1381
end
@@ -1443,7 +1443,7 @@ defmodule String do
1443
1443
def slice ( "" , _ .. _ ) , do: ""
1444
1444
1445
1445
def slice ( string , first .. - 1 ) when first >= 0 do
1446
- case String.Graphemes . split_at ( string , first ) do
1446
+ case String.Unicode . split_at ( string , first ) do
1447
1447
{ _ , nil } ->
1448
1448
""
1449
1449
{ start_bytes , _ } ->
0 commit comments