title: PowerBuilder - string to array convert
body: <p>I have string in PowerBuilder:</p>
  
  <pre><code>string test_string = "1,2,3,4,5"
  </code></pre>
  
  <p>I want to convert it to array:</p>
  
  <pre><code> string array[] = {'1','2','3','4','5'}
  </code></pre>
  
  <p>How to do that?</p>
  
  <p>// Thanks for help :)</p>
  
  <p>I do that:</p>
  
  <pre><code>    string string_to_edit = "1,2,3,4"
      string array[], string_now
      long arraylen, stringlen, place_nbr, i, place_tt
  
      stringlen = len(string_to_edit)
      DO WHILE  stringlen &gt; 0 
          place_nbr = pos(string_to_edit, ",")
              IF place_nbr &gt; 0 THEN
                  place_tt = place_nbr - 1
                  string_now = Mid(string_to_edit,0,place_tt)
                  string_to_edit = RIGHT(string_to_edit,stringlen - place_nbr)
                  stringlen = stringlen - place_nbr
              ELSE
                  string_now = string_to_edit
                  string_to_edit = RIGHT(string_to_edit,stringlen - place_nbr)
                  stringlen = 0
              END IF
          string_now = trim(string_now)
          arraylen = UpperBound(array)
          array[arraylen+1] = string_now
      LOOP
  </code></pre>