✅ Strings
StringBuilder newCrustacean = new StringBuilder();
newCrustacean.Append("fiddler crab");
Console.WriteLine(newCrustacean);
newCrustacean.Remove(0,8);
Console.WriteLine(newCrustacean);
I defined stringbuilder like this. If I say delete (0,8), c needs to be deleted as well, why not just
The word fiddler and the space are deleted.
5 Replies
because c is the 9th character? if i didnt miscount
0-f 1-i 2-d 3-d 4-l 5-e 6-r 7- space 8-c is that wrong?
Remove(0,8);
removes from 0, 8 characters
since you start counting at 0,7(space) is the 8th character
Thank you
!close
Closed!