landrews510
07-16-2007, 06:17 PM
I have a string of letters and say I want to know if the 5th letter in the string is equal to “a”. is there a way to do this.
I have tried using substring command but I get the following error, and haven't been able to find another way around the problem
string $tmp = "abbaabca";
string $letter = "a";
if ( substring $tmp 5 5 == $letter ) {
sphere -radius 5 -name "ball";
};
// Error: if ( substring $tmp 5 5 == $letter ) { //
// Error: Line 4.20: Invalid use of Maya object "substring". //
// Error: }; //
// Error: Line 6.1: Syntax error //
I have tried using substring command but I get the following error, and haven't been able to find another way around the problem
string $tmp = "abbaabca";
string $letter = "a";
if ( substring $tmp 5 5 == $letter ) {
sphere -radius 5 -name "ball";
};
// Error: if ( substring $tmp 5 5 == $letter ) { //
// Error: Line 4.20: Invalid use of Maya object "substring". //
// Error: }; //
// Error: Line 6.1: Syntax error //
