Q:

While loops with Strings not Integers

I'm having trouble finding any information on oracle plSQL while loops with strings online. All seem to be integer. When doing my research i feel i understand the integer aspect of while loops in plSQL but no sites that i have visited touched on or had examples of While Loops using strings.
For example: I can use a For loop to print individual letters from the word 'text' but what would stop me from using a While loop to get the same output? 
DECLARE
  c1 Number:= 1;
  c2 Varchar2(4);
BEGIN
  FOR c1 in 1..4
  LOOP
    SELECT substr('text' , c1 , 1 ) into c2 from dual;
    dbms_output.put_line(c2);
  END LOOP;
END;

If someone could explain how one would print a individual character or even the whole string with a while loop; or possibly point me in the right direction in terms of where to research example while loops with strings online. 
Thank you.

A:

You can write a WHILE loop entirely based on characters - no need for a counter of any kind. Something like this:
declare
  txt varchar2(100);
begin
  txt := 'my text';
  while txt is not null loop
    dbms_output.put_line(substr(txt, 1, 1));  -- or whatever else you need to do
    txt := substr(txt, 2);
  end loop;
end;
/

m
y

t
e
x
t

PL/SQL procedure successfully completed.

