@@ -1130,7 +1130,8 @@ end program demo
11301130
11311131#### Description
11321132
1133- Returns a new string_type instance which holds the lowercase version of the character sequence hold by the input string.
1133+ Returns a new string_type instance which holds the lowercase version of the
1134+ character sequence hold by the input string.
11341135
11351136#### Syntax
11361137
@@ -1150,7 +1151,7 @@ Elemental function.
11501151
11511152#### Result Value
11521153
1153- The Result is a scalar ` string_type ` value.
1154+ The result is a scalar ` string_type ` value.
11541155
11551156#### Example
11561157
@@ -1175,7 +1176,8 @@ end program demo
11751176
11761177#### Description
11771178
1178- Returns a new string_type instance which holds the uppercase version of the character sequence hold by the input string.
1179+ Returns a new string_type instance which holds the uppercase version of the
1180+ character sequence hold by the input string.
11791181
11801182#### Syntax
11811183
@@ -1195,7 +1197,7 @@ Elemental function.
11951197
11961198#### Result Value
11971199
1198- The Result is a scalar ` string_type ` value.
1200+ The result is a scalar ` string_type ` value.
11991201
12001202#### Example
12011203
@@ -1220,9 +1222,13 @@ end program demo
12201222
12211223#### Description
12221224
1223- Returns a new string_type instance which holds the titlecase (or capitalized) version of the character sequence hold by the input string.
1224- Capitalized version: The first alphabetical character of the input character sequence is transformed to uppercase unless it
1225- follows a numeral and the rest of the characters in the sequence are transformed to lowercase.
1225+ Returns a new string_type instance which holds the titlecase version
1226+ of the character sequence hold by the input string.
1227+ Title case: First character of every word in the sentence is converted to
1228+ uppercase and the rest of the characters are converted to lowercase.
1229+ A word is a contiguous sequence of character(s) which consists of alphabetical
1230+ character(s) and numeral(s) only and doesn't exclude any alphabetical character
1231+ or numeral present next to either of its 2 ends.
12261232
12271233#### Syntax
12281234
@@ -1242,31 +1248,80 @@ Elemental function.
12421248
12431249#### Result Value
12441250
1245- The Result is a scalar ` string_type ` value.
1251+ The result is a scalar ` string_type ` value.
12461252
12471253#### Example
12481254
12491255``` fortran
1250- program demo
1251- use stdlib_string_type
1256+ program demo_to_title
1257+ use stdlib_string_type, only: string_type, to_title
12521258 implicit none
12531259 type(string_type) :: string, titlecase_string
12541260
1255- string = "Titlecase This String "
1256- ! string <-- "Titlecase This String "
1261+ string = "titlecase this string. "
1262+ ! string <-- "titlecase this string. "
12571263
12581264 titlecase_string = to_title(string)
1259- ! string <-- "Titlecase This String"
1260- ! titlecase_string <-- "Titlecase this string"
1261- end program demo
1265+ ! string <-- "titlecase this string."
1266+ ! titlecase_string <-- "Titlecase This String."
1267+ end program demo_to_title
1268+ ```
1269+
1270+ <!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
1271+ ### To\_ sentence function
1272+
1273+ #### Description
1274+
1275+ Returns a new string_type instance which holds the sentencecase
1276+ version of the character sequence hold by the input string.
1277+ Sentencecase version: The first alphabetical character of the input character sequence
1278+ is transformed to uppercase unless it follows a numeral and the rest of the
1279+ characters in the sequence are transformed to lowercase.
1280+
1281+ #### Syntax
1282+
1283+ ` sentencecase_string = [[stdlib_string_type(module): to_sentence(interface)]] (string) `
1284+
1285+ #### Status
1286+
1287+ Experimental
1288+
1289+ #### Class
1290+
1291+ Elemental function.
1292+
1293+ #### Argument
1294+
1295+ ` string ` : Instance of ` string_type ` . This argument is ` intent(in) ` .
1296+
1297+ #### Result Value
1298+
1299+ The result is a scalar ` string_type ` value.
1300+
1301+ #### Example
1302+
1303+ ``` fortran
1304+ program demo_to_sentence
1305+ use stdlib_string_type, only: string_type, to_sentence
1306+ implicit none
1307+ type(string_type) :: string, sentencecase_string
1308+
1309+ string = "sentencecase this string."
1310+ ! string <-- "sentencecase this string."
1311+
1312+ sentencecase_string = to_sentence(string)
1313+ ! string <-- "sentencecase this string."
1314+ ! sentencecase_string <-- "Sentencecase this string."
1315+ end program demo_to_sentence
12621316```
12631317
12641318<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
12651319### Reverse function
12661320
12671321#### Description
12681322
1269- Returns a new string_type instance which holds the reversed version of the character sequence hold by the input string.
1323+ Returns a new string_type instance which holds the reversed version of the
1324+ character sequence hold by the input string.
12701325
12711326#### Syntax
12721327
@@ -1286,7 +1341,7 @@ Elemental function.
12861341
12871342#### Result Value
12881343
1289- The Result is a scalar ` string_type ` value.
1344+ The result is a scalar ` string_type ` value.
12901345
12911346#### Example
12921347
0 commit comments