Remove "&" charachter from string

Hi,
Please inform me how can i remove the & from string.
i try this but not working.
SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;
Also i want to remove any special character from statement.
many thanks

Ayham wrote:
i try this but not working.
SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;Are you getting any error?
SQL> set define off
SQL> SELECT REPLACE('raise the level of &performance, creativity','&') COL1
  2  FROM DUAL;
COL1
raise the level of performance, creativity>
Also i want to remove any special character from statement.
Search the forum..
Sample:Re: How to find Special Characters in a single query
Edited by: jeneesh on Sep 17, 2012 12:26 PM

Similar Messages

  • Removing unwanted from string

    I am trying to remove unwanted from a string. For example:
    String is "boy the movie part 2 (2009)". from this string i wanted to remove "(2009)" only, so my string can be looked like as "boy the movie part 2".
    Please provide me logic to do this.
    Thanks,
    Amol

    gimbal2 wrote:
    Hey if that's all you need:
    [snip]
    Just substring minus the last six characters and to not have to make any assumptions about whitespace being present in the result, a trim() is added for the fun of it.
    This is absolutely not fail proof, but it does what you ask.@OP: Most likely this is not what you really want. However, as gimbal2 points out, it does what you ask. The lesson is, you need to be clear and precise in expressing your requirements. To drive the point home, here is some more code that does what you asked for, but probably not what you really want it do do.
    if (str.equals("boy the movie part 2 (2009)") {
      str = "boy the movie part 2";
    }

  • Best way to remove apostrophe from string when loadiing

    Hi using an insert statement to load data some apostrophe's in string .
    We need to ensure all aposrophe's removed from such strings on loading/.
    What is best way to achive ethis.
    Uisng 11.2.0.3
    Thanks

    Use replace fucntion
    Please post ur DDL and DML for the table
    For examples you can see this
    how do i replace  single quotes in a string with say  ''  or null
    select replace('ab''''''''cd','''',' ') from dual;
    CREATE TABLE my_table
         istrng  varchar2(33)
    insert into my_table
    select replace('ab''''''''cd','''',' ') from dual;Please mark your questions as answered
          user5716448     
    Handle:      user5716448 
    Status Level:      Newbie
    Registered:      Mar 16, 2010
    Total Posts:      343
    Total Questions:      131 (80 unresolved)Edited by: Rahul India on Jan 29, 2013 6:04 PM

  • Remove .00 from string while conversion

    How do i remove .00, .01 from the string while converting that string to int
    i tried to do this
    Select REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') from table
    UPDATE table
    SET [CASES_d] = CAST(REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') AS INT)
    I get the error
    Conversion failed when converting the varchar value '1.10' to data type int.
    can somebody help
    Thanks

    Sorry, in that code I missed intermediate conversion into decimal(10,2). I forgot we can not convert directly.
    So, try:
    update table set cases_id = case when cases like '%[^0-9.]%' then 0 else cast(cast(Cases as decimal(10,2)) as int) end
    where cases not like '%[^0-9.]%' -- exclude updating bad rows
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Removing comma (,) from string

    Hello Friends,
    I have a string something of this nature
    Sting : ',3456,45454,,45454,'
    Need to have just comma seperated value : '3456,45454,45454'
    Tried with replace but getting - '34564545445454'
    select replace ( ltrim(RTRIM(replace(',3456,45454,,45454,', ',,', ','),',')),',', '') from dual;
    Appreciate your help .
    Thanks/Kumar

    Hi, Kumar,
    kumar73 wrote:
    Hello Friends,
    I have a string something of this nature
    Sting : ',3456,45454,,45454,'
    Need to have just comma seperated value : '3456,45454,45454'
    Tried with replace but getting - '34564545445454'
    select replace ( ltrim(RTRIM(replace(',3456,45454,,45454,', ',,', ','),',')),',', '') from dual;Do you want to remove ','s at the beginning of the string, but leave them in the other places?
    If so:
    LTRIM (string, ',')LTRIM removes the given character(s) from the <b>L</b>eft side (that is, the beginning) of string. That's all you want here. (Was your string generated by SYS_CONNECT_BY_PATH? This is a very common problem.)
    RTRIM removes the given character(s) from the <b>R</b>ight side (that is, the end) of string. I don't think you want that; you certainly don;'t need it in the example you gave.
    REPLACE removes the given characters anywhere in the string. You definitely don't want that. If you did, there would be no point in also using LTRIM or RTRIM.

  • Removing characters from string after a certain point

    Im very new to java programming, so if this is a realy stupid question, please forgive me
    I want to remove all the characters in my string that are after a certain character, such as a backslash. eg: if i have string called "myString" and it contains this:
    109072\We Are The Champions\GEMINI
    205305\We Are The Champions\Queen
    4416\We Are The Champions\A Knight's Tale
    a00022723\We Are The Champions\GREEN DAYi would like to remove all the characters after the first slash (109072*\*We...) leaving the string as "109072"
    the main problem is that the number of characters before and after is not the always the same, and there is often letters in the string i want, so it cant be separated by removing all letters and leaving the numbers
    Is there any way that this can be done?
    Thanks in advance for all help.

    You must learn to use the Javadoc for the standard classes. You can download it or reference it on line. For example [http://java.sun.com/javase/6/docs/api/java/lang/String.html|http://java.sun.com/javase/6/docs/api/java/lang/String.html].

  • How to Remove Text From Strings ?

    Hi,
    The question I have is, in the String that I have Pasted below, how can I remove the first line (>gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptor) and then use the remainder of the text to Post to a web server?
    I have tried doing this with a Regex (Pattern P = Pattern.compile("(^>.*)");), I'm able to capture the first line of text, but am not sure how to remove it and then use the rest of the text to Post to the web server.
    Any Help with this would be much appreciated
    gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptorGGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCGTCAGAGCCAGACCCT
    CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCGCGCCGGGGAAGGAGG
    TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTCAAATCTGTGATTGAA
    CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTGTTTGTTTTTTAACCT
    GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTGAAGTCACTCGAAGGG
    GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGAGATGTCCGGGAGATT
    TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGCCGAAGAGCGGAAGGA
    AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCAGAGACTGGCGATGCC
    CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAACGAATACTGCTCCCTC
    TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGTCACACCCCTTCCAGG

    String foo = "gi|23821530|dbj||SEG_D10989S Bos taurus
    gene for endothelin receptor";
    String totalString = "gi|23821530|dbj||SEG_D10989S Bos
    taurus gene for endothelin receptor
    GGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCG
    CAGAGCCAGACCCT
    CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCG
    GCCGGGGAAGGAGG
    TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTC
    AATCTGTGATTGAA
    CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTG
    TTGTTTTTTAACCT
    GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTG
    AGTCACTCGAAGGG
    GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGA
    ATGTCCGGGAGATT
    TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGC
    GAAGAGCGGAAGGA
    AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCA
    AGACTGGCGATGCC
    CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAAC
    AATACTGCTCCCTC
    TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGT
    ACACCCCTTCCAGG";
    int position = -1;
    int lenght = -1;
    position = totalString.indexOf(foo) + foo.length();
    String processedString =
    totalString.substring(position);
    Thanks for the post,
    Did the job perfectly!
    cheers again

  • Remove tabs from string

    hey
    I've a string like "1 2 3 4" and i want to filter the tabs, the requested result is : "1234"
    I was wondering if there any easy way (some String method ?) that i can use
    Thanks

    igalep132 wrote:
    thanks for quick answer
    it's not what i need...
    eventually i need one string like "1234", without empty sringsCute; how many characters does the String "abcd" contain? Four? Nope, there are a kazillion empty strings between each character, you just can't see them ;-)
    kind regards,
    Jos

  • Remove tokens from string and sort string via  XSLT mapping

    Hi,
    I have a requirement wherein I need to sort the records in an XML file with customer num & order number.
    The value of order number is concatenation of order and item like: 3249_110 , 3249_10, 3290_110,3290_10 and so on.
    Expected result:
    3249_10
    3249_110
    3290_10
    3290_110
    The sort on order number is not giving correct result as its not considering it as an number and the output I am getting is:
    3249_110
    3249_10
    3290_110
    3290_10
    code used:
    <xsl:for-each select="DELIVERYHEADER">
                   <xsl:sort select="./EXTCUSTOMERNO"/>
                   <xsl:sort data-type="number" order="ascending" select="/EXTORDERNO"/>
                   <xsl:copy-of select=".">
                   </xsl:copy-of>
    Please suggest.
    Thanks!
    Indu Khurana

    Source:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ORIONSHIPMENTS>
         <TRIP>
              <ACTION>I</ACTION>
              <SHIFTNO>1</SHIFTNO>
              <SEQUENCENO>1</SEQUENCENO>
              <DATE>2010-12-20 00:00:00</DATE>
              <STARTDATE>2010-12-20 06:00:00</STARTDATE>
              <ENDDATE>2010-12-20 14:54:00</ENDDATE>
              <TRIPNO>10</TRIPNO>
              <TRIPMNEMONIC/>
              <DRIVERID>DRIVERORT2</DRIVERID>
              <DRIVERNO>DRIVERORT2</DRIVERNO>
              <EXTDRIVERNO>12345</EXTDRIVERNO>
              <TRUCKID>Truck 01</TRUCKID>
              <TRUCKNO>Truck 01</TRUCKNO>
              <EXTTRUCKNO>5002053</EXTTRUCKNO>
              <TRAILERID>Trailer 2</TRAILERID>
              <TRAILERNO>Trailer 2</TRAILERNO>
              <EXTTRAILERNO>ORTEC00002</EXTTRAILERNO>
              <DELIVERYCT>2</DELIVERYCT>
              <LOADCT>1</LOADCT>
              <STARTDEPOTNO>GHENT_N</STARTDEPOTNO>
              <EXTSTARTDEPOTNO>4020</EXTSTARTDEPOTNO>
              <ENDDEPOTNO>GHENT_N</ENDDEPOTNO>
              <EXTENDDEPOTNO>4020</EXTENDDEPOTNO>
              <STARTLOCATIONNO>GHENT_N</STARTLOCATIONNO>
              <EXTSTARTLOCATIONNO>4020</EXTSTARTLOCATIONNO>
              <ENDLOCATIONNO>GHENT_N</ENDLOCATIONNO>
              <EXTENDLOCATIONNO/>
              <ANCILLARYTIME>0</ANCILLARYTIME>
              <LOADINGTIME>0</LOADINGTIME>
              <DISCHARGETIME>245</DISCHARGETIME>
              <DRIVETIME>289</DRIVETIME>
              <DISTANCE>0</DISTANCE>
              <LOADINGSTARTED>0</LOADINGSTARTED>
              <COMMENT/>
              <LOAD>
                   <ACTION>I</ACTION>
                   <LOADID />
                   <LOADIDADD />
                   <SEQUENCENO>0</SEQUENCENO>
                   <LOADINGDEPOTNO>GHENT_N</LOADINGDEPOTNO>
                   <EXTLOADINGDEPOTNO>4020</EXTLOADINGDEPOTNO>
                   <LOADINGPOINT />
                   <AUTHORISATIONCODE />
                   <COMPARTMENTTO>
                        <COMPARTMENTNO>1</COMPARTMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <VOLUME>65</VOLUME>
                        <UOM>LT</UOM>
                   </COMPARTMENTTO>
              </LOAD>
              <DELIVERYHEADER>
                   <ACTION>I</ACTION>
                   <SEQUENCENO>1</SEQUENCENO>
                   <ORDERNO>3949_20</ORDERNO>
                   <EXTORDERNO>3949_201</EXTORDERNO>
                   <CUSTORDERNO>01.01 Crea</CUSTORDERNO>
                   <CUSTOMERNO>0050000001</CUSTOMERNO>
                   <EXTCUSTOMERNO>0050000001</EXTCUSTOMERNO>
                   <DELIVERYNAME>TEST ORTEC</DELIVERYNAME>
                   <DELIVERYADDRESS1>Rue de Belgique</DELIVERYADDRESS1>
                   <DELIVERYADDRESS2/>
                   <DELIVERYADDRESS3/>
                   <DELIVERYPOSTCODE/>
                   <DELIVERYTOWN/>
                   <DELIVERYCOUNTRY>BE</DELIVERYCOUNTRY>
                   <INVOICENAME/>
                   <INVOICEADDRESS1/>
                   <INVOICEADDRESS2/>
                   <INVOICEADDRESS3/>
                   <INVOICEPOSTCODE/>
                   <INVOICETOWN/>
                   <INVOICECOUNTRY/>
                   <PHONENUMBER1/>
                   <PHONENUMBER2>0</PHONENUMBER2>
                   <TAXCODE />
                   <CUSTOMERCOMMENTS>0013</CUSTOMERCOMMENTS>
                   <DELIVERYCOMMENTS/>
                   <DOCUMENTTYPE>2</DOCUMENTTYPE>
                   <DELIVERYWINDOWSTARTDATE>2010-12-20 00:00:00</DELIVERYWINDOWSTARTDATE>
                   <DELIVERYWINDOWENDDATE>2010-12-20 23:59:00</DELIVERYWINDOWENDDATE>
                   <DELIVERYLINECT>1</DELIVERYLINECT>
                   <DELIVERYAUTHORISATIONREQUIRED/>
                   <CUSTOMERLANGUAGE/>
                   <CONTACTNAME/>
                   <COMPANYREFERENCE/>
                   <CUSTOMERTAXNO/>
                   <FISCALDELIVERY>0</FISCALDELIVERY>
                   <PAYMENTMETHOD>0</PAYMENTMETHOD>
                   <PAYMENTDAYSDUE>999</PAYMENTDAYSDUE>
                   <CURRENCY/>
                   <CALLBEFOREDELIVERY>0</CALLBEFOREDELIVERY>
                   <GEOFENCEDISTANCE>0</GEOFENCEDISTANCE>
                   <GEOFENCEPHONE/>
                   <SITEACCESSGRADE/>
                   <NORMALTAXRATE/>
                   <SPECIALTAXRATE>0</SPECIALTAXRATE>
                   <DISCOUNT>0</DISCOUNT>
                   <SIGNATURECAPTURED/>
                   <DISTANCELOADINGDEPOT>184</DISTANCELOADINGDEPOT>
                   <DRIVETIMELOADINGDEPOT>145</DRIVETIMELOADINGDEPOT>
                   <DISTANCENEXTSTOP>0</DISTANCENEXTSTOP>
                   <DRIVETIMENEXTSTOP>0</DRIVETIMENEXTSTOP>
                   <LOADRELEVANT/>
                   <DELIVERYLINE>
                        <ACTION>I</ACTION>
                        <MOVEMENTNO>3949_20001</MOVEMENTNO>
                        <EXTMOVEMENTNO>3949_20</EXTMOVEMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <PLANNEDQTY>20</PLANNEDQTY>
                        <UOM>LT</UOM>
                        <PRICEPERUNIT/>
                        <DISCOUNT/>
                        <COMMENTS/>
                        <COMPARTMENTFROM>
                             <COMPARTMENTNO>1</COMPARTMENTNO>
                             <VOLUME>0</VOLUME>
                             <TANKNO>1</TANKNO>
                             <EXTTANKNO>1</EXTTANKNO>
                             <TANKID>259454</TANKID>
                             <TANKLABEL/>
                             <PRODUCTNO>401611</PRODUCTNO>
                             <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                             <UOM>LT</UOM>
                        </COMPARTMENTFROM>
                   </DELIVERYLINE>
              </DELIVERYHEADER>
              <DELIVERYHEADER>
                   <ACTION>I</ACTION>
                   <SEQUENCENO>2</SEQUENCENO>
                   <ORDERNO>3949_110</ORDERNO>
                   <EXTORDERNO>3949_110</EXTORDERNO>
                   <CUSTORDERNO>01.01 Crea</CUSTORDERNO>
                   <CUSTOMERNO>0050000001</CUSTOMERNO>
                   <EXTCUSTOMERNO>0050000001</EXTCUSTOMERNO>
                   <DELIVERYNAME>TEST ORTEC</DELIVERYNAME>
                   <DELIVERYADDRESS1>Rue de Belgique</DELIVERYADDRESS1>
                   <DELIVERYADDRESS2/>
                   <DELIVERYADDRESS3/>
                   <DELIVERYPOSTCODE/>
                   <DELIVERYTOWN/>
                   <DELIVERYCOUNTRY>BE</DELIVERYCOUNTRY>
                   <INVOICENAME/>
                   <INVOICEADDRESS1/>
                   <INVOICEADDRESS2/>
                   <INVOICEADDRESS3/>
                   <INVOICEPOSTCODE/>
                   <INVOICETOWN/>
                   <INVOICECOUNTRY/>
                   <PHONENUMBER1/>
                   <PHONENUMBER2>0</PHONENUMBER2>
                   <TAXCODE />
                   <CUSTOMERCOMMENTS>0013</CUSTOMERCOMMENTS>
                   <DELIVERYCOMMENTS/>
                   <DOCUMENTTYPE>2</DOCUMENTTYPE>
                   <DELIVERYWINDOWSTARTDATE>2010-12-20 00:00:00</DELIVERYWINDOWSTARTDATE>
                   <DELIVERYWINDOWENDDATE>2010-12-20 23:59:00</DELIVERYWINDOWENDDATE>
                   <DELIVERYLINECT>1</DELIVERYLINECT>
                   <DELIVERYAUTHORISATIONREQUIRED/>
                   <CUSTOMERLANGUAGE/>
                   <CONTACTNAME/>
                   <COMPANYREFERENCE/>
                   <CUSTOMERTAXNO/>
                   <FISCALDELIVERY>0</FISCALDELIVERY>
                   <PAYMENTMETHOD>0</PAYMENTMETHOD>
                   <PAYMENTDAYSDUE>999</PAYMENTDAYSDUE>
                   <CURRENCY/>
                   <CALLBEFOREDELIVERY>0</CALLBEFOREDELIVERY>
                   <GEOFENCEDISTANCE>0</GEOFENCEDISTANCE>
                   <GEOFENCEPHONE/>
                   <SITEACCESSGRADE/>
                   <NORMALTAXRATE/>
                   <SPECIALTAXRATE>0</SPECIALTAXRATE>
                   <DISCOUNT>0</DISCOUNT>
                   <SIGNATURECAPTURED/>
                   <DISTANCELOADINGDEPOT>184</DISTANCELOADINGDEPOT>
                   <DRIVETIMELOADINGDEPOT>145</DRIVETIMELOADINGDEPOT>
                   <DISTANCENEXTSTOP>173</DISTANCENEXTSTOP>
                   <DRIVETIMENEXTSTOP>144</DRIVETIMENEXTSTOP>
                   <LOADRELEVANT/>
                   <DELIVERYLINE>
                        <ACTION>I</ACTION>
                        <MOVEMENTNO>3949_110001</MOVEMENTNO>
                        <EXTMOVEMENTNO>3949_110</EXTMOVEMENTNO>
                        <PRODUCTNO>401611</PRODUCTNO>
                        <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                        <PLANNEDQTY>45</PLANNEDQTY>
                        <UOM>LT</UOM>
                        <PRICEPERUNIT/>
                        <DISCOUNT/>
                        <COMMENTS/>
                        <COMPARTMENTFROM>
                             <COMPARTMENTNO>1</COMPARTMENTNO>
                             <VOLUME>0</VOLUME>
                             <TANKNO>1</TANKNO>
                             <EXTTANKNO>1</EXTTANKNO>
                             <TANKID>259454</TANKID>
                             <TANKLABEL/>
                             <PRODUCTNO>401611</PRODUCTNO>
                             <EXTPRODUCTNO>000000000000401611</EXTPRODUCTNO>
                             <UOM>LT</UOM>
                        </COMPARTMENTFROM>
                   </DELIVERYLINE>
              </DELIVERYHEADER>
         </TRIP>
    </ORIONSHIPMENTS>

  • How to remove the comma from string

    Hi,
    I Have string like below :
    String some1="123,44.22";
    I want to remove comma from string and final output should be 12244.22.
    public class getOut{
    public static void main(String args[]){
    String some1="123,44.22";
    getChars(int 0,some1.length(),char[] dst,0);
    can somebody in the forum give me idea how to remove comma from the String and
    have a string without comma.
    Thanks
    Jack

    int idx = oldString.indexOf(',');
    if(idx >= 0)   
          newString = oldString.substring(0, idx) + oldString.substring(idx + 1);or for jdk 1.4 and later
    str = str.replaceAll(",", "");

  • Help :how to remove spaces in string

    could any body please help me in removing spaces from string suppose i have written vivek chhabra and i want to remove spaces in this string and want a string vivekchhabra then how this could be done
    anybody help me please
    vivek

    String string = "Hello - This is a test!";
    String result = string.replaceAll(" ", "");
    System.out.println(result);This code results the following output:
    Hello-Thisisatest!

  • Removing binary characters/ special chrs from string entered by user

    Dear gurus,
    I have a string entered by users in database from where i am pulling data into SAP BW.
    Th problem is that the string contains binary characters. It is showing error and cant be upoaded
    Is there any function module/ code that removes binary data an special chrs from string??
    Pls help. thanks.

    Hi,
    U can use the Tcode:  RSKC,
    to allow the special charecters...
    otherwise if u r sure that u r facing only that type of errors..then u can allow the
    errors in ERROR HANDLING tab present in the infopackage screen < Update tab
    bye,
    sunil4points

  • Remove $%&* characters from a String

    Hi,
    I have the following program that is supposed to detect a subsequence from a String (that contains $ signs) and remove it. This is a bit tricky, since because of $ signs, the replaceAll method for String does not work. When I use replaceAll for removing the part of the String w/ no $ signs, replaceAll works perfectly, but my code needs to cover the $ signs as well.
    So far, except for replaceAll, I have tried the following, with the intent to first remove $ signs from only that specific sequence in the String (in this case from $d $e $f) and then remove the remaining, which is d e f.
    If anyone has any idea on this, I would greatly appreciate it!
    Looking forward to your help!
    public class StringDivider {
         public static void main(String [] args)
              String symbols = "$a $b $c $d $e $f $g $h $i $j $k l m n o p";
             String removeSymbols = "$d $e $f";
             int startIndex = symbols.indexOf(removeSymbols);
             int endIndex = startIndex + removeSymbols.length()-1;
             for(int i=startIndex;i<endIndex+1;i++)
                  if(symbols.charAt(i)=='$')
                       //not sure what to do here, I tried using replace(oldChar, newChar), but I couldn't achieve my point, which is to
                       //delete $ signs from the specific sequence only (as opposed to all the $ signs)
             System.out.println(symbols);
    }

    A little modification on the last version:
    This one's more accurate.
    public class StringDivider {
         public static void main(String [] args){
              String symbols = "$a $b $c $d $e $f $g $h $i $j $k l m n o p";
                  String removeSymbols = "$d $e $f $g";
                  if(symbols.indexOf(removeSymbols)!=-1)
                       if(removeSymbols.indexOf("$")!=-1)
                            removeSymbols = removeSymbols.replace('$', ' ').trim();
                            removeSymbols = removeSymbols.replaceAll("[ ]+", " ");
                            String [] symbolsWithoutSpecialChars = removeSymbols.split(" ");
                            for(int i=0;i<symbolsWithoutSpecialChars.length;i++)
                                 symbols = symbols.replaceAll("[\\$]*"+symbolsWithoutSpecialChars, "");
                             symbols = symbols.replaceAll("[ ]+", " ");
                   else
                        symbols = symbols.replaceAll(removeSymbols, "");
              symbols = symbols.trim();
              System.out.println(symbols);

  • Removing non-numeric characters from string

    Hi there,
    I need to have the ability to remove non-numeric characters from a string and I do not know how to do this.
    Does any one know a way?
    Example:
    Present String: (02)-2345-4607
    Required String: 0223454607
    Thanks in advance

    Dear NickM
    Try this this will work...........
    create or replace function char2num(mstring in varchar2) return integer
    is
    -- Function to remove Special characters and alphebets from phone no. string field
    -- Author - Valid Bharde.(India-Mumbai)
    -- Date :- 20 Sept 2006.
    -- This Function will return numeric representation.
    -- The Folowing program is gifted to NickM with respect to his post on oracle site regarding Removing non-numeric characters from string on the said date
    mstatus number :=0;
    mnum number:=0;
    mrefstring varchar2(50);
    begin
    mnum := length(mstring);
    for x in 1..mnum loop
    if (ASCII(substr(upper(mstring),x,1)) >= 48 and ASCII(substr(upper(mstring),x,1)) <= 57) then
    mrefstring := mrefstring || substr(mstring,x,1);
    end if;
    end loop;
    return mrefstring;
    end;
    copy the above program and use it at function for example
    SQL> select char2num('(022)-453452781') from dual;
    CHAR2NUM('(022)-453452781')
    22453452781
    Chao!!!

  • Fastest way to remove html tags except url in href from string using java

    Hi All,
    Please suggest the, fastest way to remove html tags (stripe) except url in href of an anchor tag from string using java.
    Please help me with the best solution as I use parser but it's taking time to remove the html tags from string of file.
    I want the program should give the performance as 1 millisecond for 2kb file.
    Please help me out... Thanks in advance

    Hi,
    how can I replace the anchor tag in a string, by the url in the href of that anchor tag by using jsoup,
    e. g.
    <code>
    suppose input text is :
    test, string using, dsfg, 1:14 PM, < a t a r ge t="_ablank" s t y l e = " color: red" h r e f = " h t t p : / / t e s t u r l . c o m / i n d e x . j s p ? a = 1 2 3 4 " > s u p p o r t < / a >, s c h e d u l a r t a g , < a t a r g e t = " _ vbblank " s t y l e = " c o l o r : g r e e n " h r e f = " h t t p : / / t e s t u r l g r e e n . c o m / i n d e x . j s p ? a = a s d f a s df 4 " > s u pp o r t r e q < / a > a s d f pq r
    then out put text should be :
    test, string using, dsfg, 1:14 PM, http://testurl.com/index.jsp?a=1234, schedular tag, http://testurlgreen.com/index.jsp?a=asdfasdf4 asdf pqr
    </code>
    Please help at the earliest..
    Thanks in advance
    as this text editor is not supporting html anchor tag the example is not displaying correctly
    Edited by: 976815 on Dec 17, 2012 5:17 AM

Maybe you are looking for

  • My 33.03 home page has a large flame instead of the normal logo, is this correct

    the correct logo will appear upon start up and then it quickly changes to a different logo quickly... the same original with a much larger flame ... i did make a snapshot of it... but i don't know how to paste it to this message.. I'm concerned that

  • How to specify -userThreads in standalone OC4J

    I'm running standalone OC4J v10.1.3.2.0 on a linux machine. When trying to use a servlet which creates it's own thread, I receive an error message asking me to start oc4j with -userThreads option. I've tried to start oc4j with this option but it comp

  • Auto expand in FR Studio

    I have a report that when run in Workspace allows you to expand Cost Center to show the children of the report. I want to run this report under a book for a batch of monthly reports. Is there a way to have all children of the selected cost center be

  • Business Place field in FBL3n

    Hi to All, My problem is that while preparing VAT/Sales Tax return I find it very cubersome to match the figure as appearing in various related GL accounts & those shown by the reports. More so T codes like Fbl3n & Fs10n take a long time to run as a

  • No cell merge possible with adf table?

    i know that there is no cell merge possible with adf table. however i read that with trinidad table it's possible. my table has data like this: d1 - tommy - 5 d1 - tommy - 7 d2 - burpy - 3 d2 - burpy - 4 d2 - tom - 7 now i have to merge first column