String case

Revision as of 01:06, 11 February 2007 by rosettacode>Kipb (add upper case)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Demonstrates how to convert a string to UPPER CASE.

Task
String case
You are encouraged to solve this task according to the task description, using any language you may know.

JavaScript

var s = "1234.56";
var UPS = s.toUpperCase(); //or .toLowerCase()
alert(UPS);

//Or, to test in web browser URL: javascript:s="alphaBETA";alert(s.toUpperCase())

Python

s = "alphaBETA"
print s.upper()  #or s.lower()

SQL

--tested in Microsoft SQL 2005
declare @s varchar(10)
set @s = 'alphaBETA'
print upper(@s)
print lower(@s)