Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> best way to loop over string value character by character
What's the best (most performant) way to loop over a string value
character by character?
We've implemented it like this:
for i in 1 .. length(v_str) loop
c:= substr(v_str,i,1);
end loop;
I wonder if there is a better way for this. Maybe by not calling substr(), something like this:
for i in 1 .. length(v_str) loop
c:= v_str[i];
end loop;
Is it (easily) possible to convert the string into an array (and loop over the array consequently)?
thanks,
stephan
Received on Fri Sep 02 2005 - 05:41:36 CDT
![]() |
![]() |