Well, there are many ways to do this, and they all depend on how you recieve the input.
Personally, were I coding the program from scratch, I would do something like
string bob;
int num = 3;
num++;
ran = bob + Convert,ToString(num);
If the input constantly starts with "ran", you could do a string search for ran, then see what comes afterwards. The rest you could convert to an integer, manually increment it, then add "ran" onto the beginning.
Need more information on the problem to help you further.
Michael Cullen