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
Of course. Give this a try:Would it be possible to merge it with the first script just as to uppercase the first letter of the material?
string $nodeName[] = `ls -sl -tr -dag`; string $matName, $sgName, $fileName; for($i=0; $i<size($nodeName); $i++) { $matName = `shadingNode -as phong -n ($nodeName[$i])`; $sgName = `sets -renderable true -noSurfaceShader true -empty -name ($nodeName[$i] + "SG")`; connectAttr -f ($matName + ".outColor") ($sgName + ".surfaceShader"); select $nodeName[$i]; sets -e -forceElement $sgName; int $nameSize = `size $matName`; string $firstCharacter = `substring $matName 1 1`; string $rest = `substring $matName 2 $nameSize`; string $newName = `toupper $firstCharacter` + $rest; rename $matName $newName; } clear $nodeName;