Why doesn't this work ?
string myString = "test";
int i = myString.Length; // i = 4
myString.PadLeft(5, '_'); // "myString" is should be equal to "_test", but it still "test"
i = myString.Length; // i = 4 (should be 5)
Most string methods don't change string itself, but return new string, so use it like this:
myString = myString.PadLeft(5, '_');
EDIT: Ahh yes, all methods. I thought about methods that don't return string and somehow ended with not entirely true sentence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With