title: How to get value from list string?
body: <p>The return result of string list is :</p>
  
  <pre><code>var result= "1,red,2,blue,3,green,4,orange";
  </code></pre>
  
  <p>I want to use a loop and get result like <code>1,2,3,4</code> and <code>red,blue,green,orange</code></p>
  
  <p>My code is as below.
  I got the error in split.
  Object does not support for split().
  I am using jquery 1.10.1 .</p>
  
  <pre><code>$.ajax({
                          type: "GET",
                          url: "/_vti_bin/userService/myservice.svc/GetUserListForMentionSign?query" + query,
                          async: false,
                          dataType: "JSON",
                          cache: false,
                          processdata: true,
                          success: function (result) {
                              data = result;
                              //arrary
                              var resultArray = data.Split(',');
  
                              var id = new Array(), name = new Array();
  
                              $.each(resultArray, function (index, value) {
                                  if (isNaN(value)) {
                                      name.push(value);
                                      alert(name.push(value));
                                  }
                                  else {
                                      id.push(value);
                                  }
                              });
  </code></pre>
  
  <p>Here is the web service for c#.</p>
  
  <pre><code>public List&lt;string&gt; GetUserListForMentionSign(string username)
      {
          List&lt;User&gt; UserList = new List&lt;User&gt;();
          List&lt;string&gt; returnvalue=new List&lt;string&gt;();
          try
          {
              string returnstring = string.Empty;
              DataTable dt = null;
              dt = Library.Helper.FindUser(username, 200);
              foreach (DataRow dr in dt.Rows)
              {
                  if (dr["Title"].ToString() != "Person.aspx")  // those user without the name
                  {
                      User user = new User();
                     user.id = dr["ID"].ToString();
                      user.name = dr["Name"].ToString();
  
                      UserList.Add(spuser);
                  }
              }
          }
  catch (Exception ex)
          {
  
          }
            return UserList.Select(a=&gt;new[]{ a.name.ToString(),a.id.ToString()}).SelectMany(a=&gt;a).ToList();
      }
  </code></pre>