frankcollins3 / fcc-mcsft-cSharp

FreeCodeCamp & Microsoft C# course:
1 stars 0 forks source link

.Remove() seems to be removing more than what the expression says it is. [3:44pm] #29

Closed frankcollins3 closed 1 year ago

frankcollins3 commented 1 year ago

attempting to do: test .Remove() beyond what the microsoft provided example. Screen Shot 2023-09-10 at 3 41 24 PM

string data = "12345John Smith 5000 3 "; 123455000 3

error: Screen Shot 2023-09-10 at 3 41 16 PM

proposed approach: haven't read deeper into the explanation, asked chatGPT, or referred to docs, but I didn't understand the terminal output "123455000 3" gets cut off from: ""12345John Smith 5000 3 "; it appears 5 and a bunch of whitespace gets cut out but it still doesn't seem to add to 20 characters.

possible improvements:

frankcollins3 commented 1 year ago

got it. the deleted characters start at the index of the starting character, not at the start of the string. [4:50pm]