Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/String-case/Mercury/string-case.mercury
Normal file
16
Task/String-case/Mercury/string-case.mercury
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
:- module string_case.
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
:- implementation.
|
||||
:- import_module list, string.
|
||||
|
||||
main(!IO) :-
|
||||
S = "alphaBETA",
|
||||
io.format("uppercase : %s\n", [s(to_upper(S))], !IO),
|
||||
io.format("lowercase : %s\n", [s(to_lower(S))], !IO),
|
||||
io.format("capitalize first: %s\n", [s(capitalize_first(S))], !IO).
|
||||
% We can use uncaptitalize_first/1 to ensure the first character in a
|
||||
% string is lower-case.
|
||||
Loading…
Add table
Add a link
Reference in a new issue