Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: C#  |  size: 0.55 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.       public string CreateID(string nume,int unic)
  2.         {
  3.             try
  4.             {   string id = "";
  5.                 if (unic == 0)
  6.                 {
  7.                     string[] a = nume.Split(' ');
  8.                     id = a[0] + a[1].Substring(0, 1);
  9.                 }
  10.                 else
  11.                 {   string[] a = nume.Split(' ');
  12.                     id = a[0] + a[1].Substring(0, unic);
  13.                 }
  14.                 return id;
  15.             }
  16.             catch
  17.             {
  18.                 return "";
  19.             }
  20.         }