Advertisement
Guest User

Untitled

a guest
Nov 4th, 2014
16
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None
  1. string[] text = textBoxInput.Text.Split(' ');
  2. List<string> replacements = new List<string>();
  3.  
  4. for(int i = 0; i < text.Length; i++)
  5. {
  6.     if(replacements.Contains(text[i]))
  7.     {
  8.         text[i] = ">" + replacements.IndexOf(text[i]).ToString() + "<";
  9.     }
  10.     else
  11.     {
  12.         replacements.Add(text[i]);
  13.         text[i] = "(" + replacements.IndexOf(text[i]) + ")" + text[i];
  14.     }
  15. }
  16.  
  17. textBoxOutput.Text = String.Join(" ", text);
Advertisement
RAW Paste Data Copied
Advertisement