Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- foreach(var str in listBox1)
- {
- string tmp = string.Empty;
- for(var i = 0; i < str.Length; i++)
- {
- if(char.IsLetter(str[i]) || char.IsWhiteSpace(str[i]) || str[i] == '-') tmp += str[i];
- }
- tmp = tmp.Trim();
- listBox2.Add(tmp.Last() + tmp.Substring(1,str.Length - 2) + tmp.First()
- + str.Substring(str.LastIndexOf(tmp.Last()) + 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement