You asked about the str command in your original post. Format works fine, but you could use str in this case (just depends which method feels better for you):
_name = "cc" + str (1 + floor (random 7));
Incidentally, "random 8" gives a real number from 0.0 up to just less than 8.0. By using floor on that number, you get a random integer from 0 to 7 with equal likelyhood of each number.