proper

Convert string or array of strings to proper case.
  • proper(str) capitalizes the first letters of str and any letters that follow a non-letter character
  • proper(str, 'loose') capitalizes the first character of each word in str

Examples

> a = 'PROPER 1st example'

> proper(a)#

Proper 1St Example

> proper(a,'loose')#
	
PROPER 1st Example
> proper({'2°example: aBc', 'deF', 'ghi'},'loose')#
 
 [2°example: ABc][DeF][Ghi]	  
> t1 = table({'1-john'; '2-john'; 'sam_a'; 'toni'}, {'2-Jun-12'; '12-Feb-12'; '4-Oct-2011'; '29-Aug-12'}, 'Variablenames', {'Name', 'DOB'})

> c = t1.Name

> c1 = proper(c)#

1-John
2-John
Sam_A
Toni

> c2 = proper(c, 'loose')#

1-john
2-john
Sam_a
Toni

Resources

See also

lower | upper