I have a title like Virtual Team Resources then i need its short code like VTR
<p>I have a title like Virtual Team Resources then i need its short code like VTR
 If Title Virtual Team then ShortCOde will be VTE
 i have implement this but still some issues like
 if user enter title  Virtual T then short code will ?</p>

<p>My Code------</p>

<pre><code>function EnterShortCode() {
           debugger
           var ProjectShortCode = "";
           var Arr = $("#txtProjectTitle").val().rtrim().split(" ");
           for (i = 0; i &lt; Arr.length; i++) {
               if (Arr[i] != "" &amp;&amp; Arr[i] != null) {
                   ProjectShortCode += Arr[i].substring(0, 1);
                   if (i == Arr.length - 1) {
                       if (ProjectShortCode.length == 1) {
                           if (Arr[i] &lt; 3) {

                           }
                           else {
                               ProjectShortCode = ProjectShortCode + Arr[i].substring(1, 3);
                           }
                       }
                       else if (ProjectShortCode.length == 2) {
                           if (Arr[i] &lt; 2) {

                           }
                           else {
                               ProjectShortCode = ProjectShortCode + Arr[i].substring(1, 2)
                           }

                       }

                   }
               }
           }

           ProjectShortCode = ProjectShortCode.toUpperCase();
           alert(ProjectShortCode);
       }
</code></pre>
