@@ -355,8 +355,8 @@ _Example:_
355355``` erlang
3563561 > Reverse = string :reverse (unicode :characters_to_nfd_binary (" ÅÄÖ" )).
357357[[79 ,776 ],[65 ,776 ],[65 ,778 ]]
358- 2 > io :format (" ~ts~n " ,[Reverse ]).
359- O ̈A ̈A ̊
358+ 2 > io :format (" %% ~ts~n " ,[Reverse ]).
359+ % % ÖÄÅ
360360```
361361""" .
362362-doc (#{group => <<" Functions" >>,since => <<" OTP 20.0" >>}).
@@ -445,10 +445,10 @@ _Example:_
445445``` erlang
4464461 > string :pad (<<" He̊llö" /utf8 >>, 8 ).
447447[<<72 ,101 ,204 ,138 ,108 ,108 ,195 ,182 >>,32 ,32 ,32 ]
448- 2 > io :format (" '~ts '~n " ,[string :pad (" He̊llö" , 8 , leading )]).
449- ' He̊llö'
450- 3 > io :format (" '~ts '~n " ,[string :pad (" He̊llö" , 8 , both )]).
451- ' He̊llö '
448+ 2 > io :format (" %% '~ts '~n " ,[string :pad (" He̊llö" , 8 , leading )]).
449+ % % ' He̊llö'
450+ 3 > io :format (" %% '~ts '~n " ,[string :pad (" He̊llö" , 8 , both )]).
451+ % % ' He̊llö '
452452```
453453""" .
454454-doc (#{group => <<" Functions" >>,since => <<" OTP 20.0" >>}).
@@ -543,9 +543,9 @@ Returns a string where any trailing `\n` or `\r\n` have been removed from
543543_ Example:_
544544
545545``` erlang
546- 182 > string :chomp (<<" \n Hello\n\n " >>).
546+ 1 > string :chomp (<<" \n Hello\n\n " >>).
547547<<" \n Hello" >>
548- 183 > string :chomp (" \n Hello\r\r\n " ).
548+ 2 > string :chomp (" \n Hello\r\r\n " ).
549549" \n Hello\r "
550550```
551551""" .
@@ -583,13 +583,13 @@ taken.
583583_ Example:_
584584
585585``` erlang
586- 5 > string :take (" abc0z123" , lists :seq ($a ,$z )).
586+ 1 > string :take (" abc0z123" , lists :seq ($a ,$z )).
587587{" abc" ," 0z123" }
588- 6 > string :take (<<" abc0z123" >>, lists :seq ($0 ,$9 ), true , leading ).
588+ 2 > string :take (<<" abc0z123" >>, lists :seq ($0 ,$9 ), true , leading ).
589589{<<" abc" >>,<<" 0z123" >>}
590- 7 > string :take (" abc0z123" , lists :seq ($0 ,$9 ), false , trailing ).
590+ 3 > string :take (" abc0z123" , lists :seq ($0 ,$9 ), false , trailing ).
591591{" abc0z" ," 123" }
592- 8 > string :take (<<" abc0z123" >>, lists :seq ($a ,$z ), true , trailing ).
592+ 4 > string :take (<<" abc0z123" >>, lists :seq ($a ,$z ), true , trailing ).
593593{<<" abc0z" >>,<<" 123" >>}
594594```
595595""" .
@@ -661,7 +661,7 @@ tested for equality.
661661_ Example:_
662662
663663``` erlang
664- 2 > string :lowercase (string :uppercase (" Michał" )).
664+ 1 > string :lowercase (string :uppercase (" Michał" )).
665665" michał"
666666```
667667""" .
@@ -746,8 +746,8 @@ _Example:_
746746
747747``` erlang
7487481 > {I1 ,Is } = string :to_integer (" 33+22" ),
749- 1 > {I2 ,[]} = string :to_integer (Is ),
750- 1 > I1 - I2 .
749+ {I2 ,[]} = string :to_integer (Is ),
750+ I1 - I2 .
75175111
7527522 > string :to_integer (" 0.5" ).
753753{0 ," .5" }
@@ -787,8 +787,8 @@ _Example:_
787787
788788``` erlang
7897891 > {F1 ,Fs } = string :to_float (" 1.0-1.0e-1" ),
790- 1 > {F2 ,[]} = string :to_float (Fs ),
791- 1 > F1 + F2 .
790+ {F2 ,[]} = string :to_float (Fs ),
791+ F1 + F2 .
7927920.9
7937932 > string :to_float (" 3/2=1.5" ).
794794{error ,no_float }
@@ -871,11 +871,11 @@ parts. `Where`, default `leading`, indicates whether the `leading`, the
871871_ Example:_
872872
873873``` erlang
874- 0 > string :split (" ab..bc..cd" , " .." ).
874+ 1 > string :split (" ab..bc..cd" , " .." ).
875875[" ab" ," bc..cd" ]
876- 1 > string :split (<<" ab..bc..cd" >>, " .." , trailing ).
876+ 2 > string :split (<<" ab..bc..cd" >>, " .." , trailing ).
877877[<<" ab..bc" >>,<<" cd" >>]
878- 2 > string :split (<<" ab..bc....cd" >>, " .." , all ).
878+ 3 > string :split (<<" ab..bc....cd" >>, " .." , all ).
879879[<<" ab" >>,<<" bc" >>,<<>>,<<" cd" >>]
880880```
881881""" .
@@ -2507,13 +2507,6 @@ Returns the position where the first occurrence of `SubString` begins in
25072507` String ` . Returns ` 0 ` if ` SubString ` does not exist in ` String ` .
25082508
25092509This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` find/2 ` .
2510-
2511- _ Example:_
2512-
2513- ``` erlang
2514- 1 > string :str (" Hello Hello World World " , " Hello World" ).
2515- 8
2516- ```
25172510""" .
25182511-doc (#{group => <<" Obsolete API functions" >>}).
25192512-spec str (String , SubString ) -> Index when
@@ -2536,13 +2529,6 @@ Returns the position where the last occurrence of `SubString` begins in
25362529` String ` . Returns ` 0 ` if ` SubString ` does not exist in ` String ` .
25372530
25382531This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` find/3 ` .
2539-
2540- _ Example:_
2541-
2542- ``` erlang
2543- 1 > string :rstr (" Hello Hello World World " , " Hello World" ).
2544- 8
2545- ```
25462532""" .
25472533-doc (#{group => <<" Obsolete API functions" >>}).
25482534-spec rstr (String , SubString ) -> Index when
@@ -2572,13 +2558,6 @@ Returns the length of the maximum initial segment of `String`, which consists
25722558entirely of characters from ` Chars ` .
25732559
25742560This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` take/2 ` .
2575-
2576- _ Example:_
2577-
2578- ``` erlang
2579- 1 > string :span (" \t abcdef" , " \t " ).
2580- 5
2581- ```
25822561""" .
25832562-doc (#{group => <<" Obsolete API functions" >>}).
25842563-spec span (String , Chars ) -> Length when
@@ -2600,13 +2579,6 @@ Returns the length of the maximum initial segment of `String`, which consists
26002579entirely of characters not from ` Chars ` .
26012580
26022581This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` take/3 ` .
2603-
2604- _ Example:_
2605-
2606- ``` erlang
2607- 1 > string :cspan (" \t abcdef" , " \t " ).
2608- 0
2609- ```
26102582""" .
26112583-doc (#{group => <<" Obsolete API functions" >>}).
26122584-spec cspan (String , Chars ) -> Length when
@@ -2644,13 +2616,6 @@ Returns a substring of `String`, starting at position `Start`, and ending at the
26442616end of the string or at length ` Length ` .
26452617
26462618This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` slice/3 ` .
2647-
2648- _ Example:_
2649-
2650- ``` erlang
2651- 1 > substr (" Hello World" , 4 , 5 ).
2652- " lo Wo"
2653- ```
26542619""" .
26552620-doc (#{group => <<" Obsolete API functions" >>}).
26562621-spec substr (String , Start , Length ) -> SubString when
@@ -2675,14 +2640,7 @@ substr2([_|String], S) -> substr2(String, S-1).
26752640Returns a list of tokens in ` String ` , separated by the characters in
26762641` SeparatorList ` .
26772642
2678- _ Example:_
2679-
2680- ``` erlang
2681- 1 > tokens (" abc defxxghix jkl" , " x " ).
2682- [" abc" , " def" , " ghi" , " jkl" ]
2683- ```
2684-
2685- Notice that, as shown in this example, two or more adjacent separator characters
2643+ Notice that two or more adjacent separator characters
26862644in ` String ` are treated as one. That is, there are no empty strings in the
26872645resulting list of tokens.
26882646
@@ -2803,13 +2761,6 @@ words(String) -> words(String, $\s).
28032761Returns the number of words in ` String ` , separated by blanks or ` Character ` .
28042762
28052763This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` lexemes/2 ` .
2806-
2807- _ Example:_
2808-
2809- ``` erlang
2810- 1 > words (" Hello old boy!" , $o ).
2811- 4
2812- ```
28132764""" .
28142765-doc (#{group => <<" Obsolete API functions" >>}).
28152766-spec words (String , Character ) -> Count when
@@ -2841,13 +2792,6 @@ or `Character`s.
28412792
28422793This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use
28432794` nth_lexeme/3 ` .
2844-
2845- _ Example:_
2846-
2847- ``` erlang
2848- 1 > string :sub_word (" Hello old boy !" ,3 ,$o ).
2849- " ld b"
2850- ```
28512795""" .
28522796-doc (#{group => <<" Obsolete API functions" >>}).
28532797-spec sub_word (String , Number , Character ) -> Word when
@@ -2901,13 +2845,6 @@ Returns a string, where leading or trailing, or both, blanks or a number of
29012845[ ` strip/1 ` ] ( `strip/1` ) is equivalent to [ ` strip(String, both) ` ] ( `strip/2` ) .
29022846
29032847This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` trim/3 ` .
2904-
2905- _ Example:_
2906-
2907- ``` erlang
2908- 1 > string :strip (" ...Hello....." , both , $. ).
2909- " Hello"
2910- ```
29112848""" .
29122849-doc (#{group => <<" Obsolete API functions" >>}).
29132850-spec strip (String , Direction , Character ) -> Stripped when
@@ -2954,13 +2891,6 @@ padded with blanks or `Character`s.
29542891
29552892This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` pad/2 ` or
29562893` pad/3 ` .
2957-
2958- _ Example:_
2959-
2960- ``` erlang
2961- 1 > string :left (" Hello" ,10 ,$. ).
2962- " Hello....."
2963- ```
29642894""" .
29652895-doc (#{group => <<" Obsolete API functions" >>}).
29662896-spec left (String , Number , Character ) -> Left when
@@ -2996,13 +2926,6 @@ margin is fixed. If the length of `(String)` < `Number`, then `String` is padded
29962926with blanks or ` Character ` s.
29972927
29982928This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` pad/3 ` .
2999-
3000- _ Example:_
3001-
3002- ``` erlang
3003- 1 > string :right (" Hello" , 10 , $. ).
3004- " .....Hello"
3005- ```
30062929""" .
30072930-doc (#{group => <<" Obsolete API functions" >>}).
30082931-spec right (String , Number , Character ) -> Right when
@@ -3073,13 +2996,6 @@ Returns a substring of `String`, starting at position `Start` to the end of the
30732996string, or to and including position ` Stop ` .
30742997
30752998This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use ` slice/3 ` .
3076-
3077- _ Example:_
3078-
3079- ``` erlang
3080- 1 > sub_string (" Hello World" , 4 , 8 ).
3081- " lo Wo"
3082- ```
30832999""" .
30843000-doc (#{group => <<" Obsolete API functions" >>}).
30853001-spec sub_string (String , Start , Stop ) -> SubString when
@@ -3161,13 +3077,6 @@ Returns a string with the elements of `StringList` separated by the string in
31613077
31623078This function is [ obsolete] ( `m:string#obsolete-api-functions` ) . Use
31633079` lists:join/2 ` .
3164-
3165- _ Example:_
3166-
3167- ``` erlang
3168- 1 > join ([" one" , " two" , " three" ], " , " ).
3169- " one, two, three"
3170- ```
31713080""" .
31723081-doc (#{group => <<" Obsolete API functions" >>}).
31733082-spec join (StringList , Separator ) -> String when
0 commit comments