String Case

From Erlang Community

(Difference between revisions)
Revision as of 21:44, 18 August 2006 (edit)
Cyberlync (Talk | contribs)

← Previous diff
Revision as of 21:51, 3 September 2006 (edit) (undo)
Bfulgham (Talk | contribs)

Next diff →
Line 14: Line 14:
-[[Category:CookBook]]+[[Category:CookBook]][[Category:StringRecipes]]

Revision as of 21:51, 3 September 2006

Problem

You need to convert a string to all uppercase or all lowercase.

Solution

Use httpd_util:to_upper or httpd_util:to_lower from the OTP httpd_util module. (Yes, I know that these would make more sense in the string module!)

 
1> httpd_utils:to_upper("hello").
"HELLO"
2> httpd_utils:to_lower("ERLANG").
"erlang"

The httpd_util module contains a dog's breakfast of functionality that probably belong in other modules, but that have not been added due to backwards-compatibility concerns.

Erlang/OTP Projects
Personal tools