Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. Random rnd = new Random((int) DateTime.Now.Ticks & 0x0000FFFF);
  2. string text = project.Variables["text"].Value;
  3. int length = text.Length;
  4. string new_text = String.Empty;
  5. int max = rnd.Next(1, 3);
  6. int curr = 0;
  7.  
  8. for (int i = 0; i < length; i++) {
  9.     if ((rnd.Next(0, 3) == 1) && (i != 0) && (i != length) && (curr <= max)) {
  10.         new_text += ".";
  11.         new_text += text[i];
  12.         curr++;
  13.     } else {
  14.         new_text += text[i];
  15.     }
  16. }
  17.  
  18. return new_text;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement