Hi, with regular expression is easier, this replace all characters
except alphanumeric
one
SELECT /*+FIRST_ROWS */ REGEXP_REPLACE('OR%^$&*AC&^LE','[^[:alpha:]]') FROM
dualOn Mon, Nov 30, 2009 at 8:50 AM, Andrej Hopko <[email protected]> wrote: > I made this on to work: > > SET SERVEROUTPUT ON; > DECLARE > v_word VARCHAR2(30) := 'OR%^$&*AC&^LE'; > v_out VARCHAR2(30) := ''; > v_chr VARCHAR2(1); > BEGIN > FOR i IN 1..length(v_word) > LOOP > v_chr := SUBSTR(v_word,i,1); > IF v_chr BETWEEN 'A' AND 'Z' THEN > v_out := v_out || v_chr; > END IF; > IF v_chr BETWEEN 'a' AND 'z' THEN > v_out := v_out || v_chr; > END IF; > IF v_chr BETWEEN '0' AND '9' THEN > v_out := v_out || v_chr; > END IF; > END LOOP; > DBMS_OUTPUT.PUT_LINE(v_out); > END; > / > SET SERVEROUTPUT OFF; > > tried also regular expressions but not enough time to play ;-) > > hoppo > > On 30.11.2009 8:22, Niraj Singh The King wrote: > > Please help me in providing a sample code to remove special characters > > from a string > > > > For E.g if i give string "OR%^$&*AC&^LE" the o/p should be "ORACLE" > > -- > > Thanks and Regards, > > Niraj Singh Parihar > > Mobile Number : +919890492566. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Oracle PL/SQL" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/Oracle-PLSQL?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Oracle PL/SQL" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/Oracle-PLSQL?hl=en > -- Paweł Pasieka -- You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en
