Hi guys,
I'd like to find a way to search through a piece of text for a specific symbol
This symbol :
Think I got the hard part done, but could really use an extra brain to help with the rest
proc string checkforsymbol(string $inputName) {
if this : symbol exists within the $inputName string.
return removeNameSpace($inputName);
}else {
return $inputName;
}
proc string removeNameSpace(string $inputName){
string $outgoingName[];
$numTokens = `tokenize $inputName ":" $outgoingName`;
return $outgoingName[1];
}
Any ideas?
Replies
Alternatively you should just be able to tokenize without having to check for it first. If tokenize doesn't catch anything to split, the destination array will have a size of 1, the original string.
Perfect! Thanks Bartalon
Because Maya chooses to echo all of it's commands in Melscript.. it's simply easier for me to learn & figure out the syntax of the mel language
I have no doubt Python can do things more efficiently
I really like how you don't have to declare whether variables are strings, ints, floats, etc
or brackets even?? jeeez.. that would have saved me loads of time from trying to track down those misplaced squirrely sobs
I do like how clean it can be, variables don't have to be defined, no ending lines with semi-colons. It just feels much more efficient. Only thing you really have to watch out for is indents - messed up indents can make everything stop working.