View Single Post
# 4 19-02-2012 , 10:56 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
So you want it to automatically find words in a string, and camel case them? This would take forever in a scripting language, as it would need to run through a large dictionary of words, and compare them. Changing the first letter to upper case in a material though, is simple.

Code:
string $name = "thisisatest";

int $nameSize = `size $name`;
string $firstCharacter = `substring $name 1 1`;
string $rest = `substring $name 2 $nameSize`;

string $newName = `toupper $firstCharacter` + $rest;

print ($newName);

// Result: Thisisatest


Imagination is more important than knowledge.