title: How to loop through split string
body: <p>How can I split a string on some delimiter and then loop through the parts? I tried a few functions and loop types with no success. I am trying to achieve something like:</p>
  
  <pre><code>create or replace function splitloop() returns void
  as $$
  DECLARE
  part text;
  BEGIN
     foreach part in string_to_array('one,two,three', ',')
     loop
        -- do something with part
     end loop;
  END;
  $$ language plpgsql;
  </code></pre>