string s="firstname lastname city age country";
string s="firstname lastname city age country"; string[] parts = s.Split(' '); // split the string string lastname = parts[1]; // take the second string from the array
string s="firstname lastname lastname lastname city age country"; // each "lastname" is another word from the last namestring[] parts = s.Split(' '); // split the stringstring lastname = parts[parts.Count - 4];
string str = "This\ris\ra\rstring.";str = str.Replace("\r",""); // replace \r with an empty string
' '
'\r'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)