e r l a n g : c o o k b o o k

/ Erlang.StringControlCase

This Web


WebHome 
WebChanges 
TOC
NewRecipe 
WebTopicList 
WebStatistics 

All Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Erlang Links


Erlang.org
Erlang Wiki
ErlMan
Erlang Wiki
The Jungerl
Erlang-fr.org
Joe Armstrong
Lambda the Ultimate

Erlang Web Ring


[Prev]: Joe Armstrong's Page
[Next]: Joe Armstrong's Page

Controlling Case

Problem

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

Solution

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

For older solution, use httpd_util:to_upper() and httpd_util:to_lower()

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!)

Discussion

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.

-- BrentAFulgham - 20 Aug 2004

CookbookForm
TopicType: Recipe
ParentTopic: StringRecipes
TopicOrder: 090

 
 
Copyright © 2004 by the contributing authors. All material on the Erlang Cookbook web site is the property of the contributing authors.
This material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest