2

How can I capitalize a string in rascal?

In the documentation of the string library, I can not find any method to capitalize a string.

http://tutor.rascal-mpl.org/Rascal/Rascal.html#/Rascal/Expressions/Values/String/String.html

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51
Jaap
  • 23
  • 3

1 Answers1

3

You should use the toUpperCase function in the String library, detailed here:

http://tutor.rascal-mpl.org/Rascal/Rascal.html#/Rascal/Libraries/Prelude/String/toUpperCase/toUpperCase.html

For example:

rascal>import String;
ok

rascal>toUpperCase("hEllO WOrlD");
str: "HELLO WORLD"
Mark Hills
  • 1,028
  • 5
  • 4