PDA

View Full Version : substituteAllString command broken in 6.5???


siproductions
07-21-2007, 05:51 PM
Hey guys i've been having a problem with maya 6.5 when I try to use the substituteAllString command. I'm running this code:

string $text = "test001";
string $result = substituteAllString($text, "001", "");
print $result;

when I run this code I get this output: "tesestst0t00011"
when it should be: "test"

Am I using it wrong? I ran this in 8.5 and it works fine. Just wanted to see if I'm the only one who has experienced this. Cheers.

isoparmB
07-23-2007, 09:58 AM
Got the error too in 7.01.

string $text = "test001";
string $result = substituteAllString($text, "001", "");
print $result;
tesestst0t00011

You can use the substitute command as a workaround for single instances, though I can see a problem with multiple occurances of the search string.
string $text = "test001";
string $result = substitute("001", $text, "");
print $result;

CGTalk Moderation
07-23-2007, 09:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.