Advertisement
Guest User

czkkbskbfka

a guest
Jun 20th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. foreach(var str in listBox1)
  4. {
  5. string tmp = string.Empty;
  6.  
  7. for(var i = 0; i < str.Length; i++)
  8. {
  9. if(char.IsLetter(str[i]) || char.IsWhiteSpace(str[i]) || str[i] == '-') tmp += str[i];
  10. }
  11.  
  12. tmp = tmp.Trim();
  13.  
  14. listBox2.Add(tmp.Last() + tmp.Substring(1,str.Length - 2) + tmp.First()
  15. + str.Substring(str.LastIndexOf(tmp.Last()) + 1));
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement