Sorted by efficiency:
- Counting your AppendLine() calls
- Calling IndexOf() in a loop
- Using Regex
- Using String.Split()
The last one is extraordinary expensive and generates lots of garbage, don’t use.
Sorted by efficiency:
The last one is extraordinary expensive and generates lots of garbage, don’t use.