Salesforce Apex String replace function

Here is sample Code:

String str = 'biswajeet';
system.Debug(str.replace('b','-').replace('e', '*'));

Output:

index