Checking for Paragraph sign / Return Character with indexOf()

Hello all
Al want to use String.indexIf() method to check for any Paragraph signs, or Return characters in a string, then delete or change them.
I already tried the following, without success!
int index = myAddress.indexOf('\r');
and ('\n')
Please help
Thanks in advance
Jaco

just try to use a StringBuffer or the more diffcult way put the string into a StringTokenizer and set for delimitters all the paragraphs and whitespaces and then tokenize the string. You just have to determine the length of the splitstring and then you know where the characters are you look for

Similar Messages

  • Checks and deletes all Paragraph signs / Return Characters?

    Hello all
    I am working on a number of fields, and are looping through them. I have to check in each field for any Paragraph signs, and delete them. (In a .txt doc, the sign looks like a square)
    Here are four examples of how the records can look like:
    ¶London
    ¶
    London¶City
    London¶
    //I tried the following code without success:
    int index = Address2.indexOf('\r');
    //Here is code to try getting two substrings of the parts before and after the sign.
    //This code is also not working
    StringTokenizer myTokens = new StringTokenizer(Address2, "\r");
    while (myTokens.hasMoreTokens())
    String result1 = "";
    String result2 = "";
    result1 = myTokens.nextToken();
    Address2 = result1;
    while (myTokens.hasMoreTokens())
    result2 = result1.concat(myTokens.nextToken());
    Address2 = result2;
    Please help!! Regards
    Jaco

    The square in the .txt doc act as a Paragraph sign, but is it?
    And is the "\r" the correct representation of it?

  • Mail problem. Checking for mail never returns

    I'm having strange problem with my new iPad. I'm trying to set up email account with yahoo. It seems to verify my email address correctly however my emails never get populated. When I click on mail I just get the circle status bar in lower left corner and it says checking for mail... But nothing ever shows up in list. My settings appear to be correct and my account was successfully verified but still I'm not seeing any of my emails. I have my push settings set to manual and there's a blue on button. What am I doing wrong?
    Thank you all!!

    Some people have posted in the past that sometimes it just stops working because of a Yahoo problem. My first step in trouble shooting would bet to first check your email by the website. Maybe it is down. Next to reset the iPad and try again. Next would be delete the Yahoo account and then set it up again. When I first set u my Yahoo account I go error messages setting it up and it did not work at first either.

  • How to check for black rectangle special character

    hi ,
    i have a field that contains the black rectangle special character and when i copy it to the pl/sql's screen it's showing the square bracket. -->
    however when i saved the view it turns from to . and this has disrupted my check as follows
    field1 = '2AAC1234.11some-other-words'
    substring(field1 , instr(field1 , '')) -- i am expecting it to return 2AAC1234.11
    instead it returns me 2AAC1234 because the has turned in "." once i save the query. pls advise
    tks & rgds

    Get the ascii values for using ASCII function.
    SELECT ASCII('') FROM DUAL;--
    and then INSTR function use CHR fucntion with the ASCII value you get fron above query.
    SELECT CHR(n) FROM DUAL; it will return ''
    here n is the ascii value for ''
    Regards
    Arun Gupta

  • Compatiblity check for DB2E 8.2.4 with SAP MI Client 2.5 SP 20

    Hi all,
    We  are developing a mobile sales application for CRM using xapps MSAHH 5.0. We are using SAP MI 2.5 SP 20 and DB2E 8.2.4 . We have configured the backend for activity related data, but when try to run the application on client it is giving a error pertaining to DB2e described as :
    "MultiObjectFileStorage: Error in data read access to mapping file C:\Program Files\SAP Mobile Infrastructure\data\datreg.obj - Generating initial mapping (root cause: C:\Program Files\SAP Mobile Infrastructure\data\datreg.obj (The system cannot find the file specified) [java.io.FileNotFoundException]) "
    Although file is present at the specified location.Onthe frontend the jsp displays an error message as :
    "Download activities-related data and try again"
    Can anyone please let us know wether DB2E 8.2.4 is compatible with the client or not.
    And what else could be the problem .

    Hi Sumit,
        DB2e 8.2.4 is infact the correct version with MI 2.5 SP20.   No other versions of DB2e is supported on this SP.  The error you see w.r.t datrej.obj is not a problem and can be ignored.  May be there is some other issue that is created the jsp error.
    Best Regards
    Sivakumar

  • Check for negative sign

    Hi all,
    1. Is there any function module to check whthere the given number is negative or positive ?
    2.While running my BDC program a session is created.When this session will be processed ?
    Rgds,
    Venkonk.

    1. if NUM < 0 then its negative
        if NUM > 0 then its positive
    2.You need to go to SM35 to process this session manually.
       If you want this session to be procesed within the program you need to run or submit the program RSBDCSUB.
    Regards
    Gopi

  • Replacing return character problem

    Hello all
    I have to replace a paragraph sign (return character) in a text doc I have to import.
    In the text doc, the sign looks like a square.
    When copied to MSWord, it appears as a paragraph sign, and act as one.
    Questions:
    Is it a paragraph sign?
    How do I represent this sign in Java to replace it by using StringTokenizer?
    Can I also use indexOf() method to do it?
    I tried using ("\r"), but it was unsuccessfull.
    Any other ideas?
    Please help!
    Regards
    Jaco

    when you have your text printed in NotePad for example,
    return character is not \r but \r\n (return carriage + new line)
    try to print all the ASCII codes using the code :
    public class Test {
    private static void printCodes(String p_text) {
    for(int i=0;i<p_text.length();i++) {
    System.out.println("char "+p_text.charAt(i)+" : "+(int) p_text.charAt(i));
    public static void main(String [] args) {
    printCodes("some text here\r\n and there.");

  • Carriage return in textarea - how do I check for and remove it???

    I have an html form that has a <textarea> element for user input. I work mainly with Java and some JavaScript. Since carriage returns are permitted in a <textarea> element, upon retrieving the value submitted, my Java and/or JavaScript variables contain carriage returns as well, making the values incomplete.
    For Example :
    String dataSubmitted = request.getParameter("formInput");
    <script language="JavaScript">
    var textValue = "<%=dataSubmitted%>";
    ....//do other stuff
    </script>When I view the source of my JSP page, the above statement of code looks like this:
    var textValue = "This is some text that
    I submitted with a carriage return";I'm putting the text submitted through this form into a mysql database, and when I pull up the values I find that it has recorded the carriage return as well. There is an actual symbol representing a carriage return in the db field.
    What I'd like to do is use some Java code to go through each character of the String and find and remove the carriage return, perhaps replacing it with an empty space instead. But how do I check for a carriage return in a String variable?
    Also, is there a way to use JavaScript to alert the user when the carriage return button is pressed when they're in the <textarea>?
    Any input is appreciated,
    Thank You,
    -Love2Java

    What I'd like to do is use some Java code to go through
    each character of the String and find and remove the
    carriage return, perhaps replacing it with an empty
    space instead. But how do I check for a carriage return
    in a String variable?The carriage return is represented by the \r. Generally there is also a newline, the \n. You can use String#replaceAll() to replace occurences of them by a space.
    string = string.replaceAll("\r\n", " ");
    Also, is there a way to use JavaScript to alert the user
    when the carriage return button is pressed when they're
    in the <textarea>?You can capture keys using the 'onkeypress' attribute. The keyCode of a the return key is 13. So simply catch that:<textarea onkeypress="if (event.keyCode == 13) alert('You pressed the return button.'); return false;"></textarea>The return false prohibits the linebreak being inserted. If you remove that, then it will be inserted anyway.

  • ITunes 10 will not connect to Store, let me sign in, check for updates on Windows Vista 32 bit.

    Has anyone had trouble connecting to the iTunes Store while using Itunes 10 for PC?
    I cannot check for updates, sign in, or connect to the store so all my app downloads must be done from my device.
    Using:
    Windows Vista 32-bit.
    Cox McAfee anti-virus/firewall.

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • Check for non-numeric characters in textbox input

    I have a form with several textboxes, each of which can accept numeric input. I want to write a validation/ plsql block that checks for a non-numeric character in the input, so that my user sees a customized error message rather than a database error. Any tips on how I can achieve that? Is there any function like "isalpha" in C, which can directly do the job?
    Also, some of these numeric fields should allow commas, since people put commas in larger numbers.
    Any help is greatly appreciated.

    Arie,
    i figured it out. turns out, i had some confusion in my mind. i modified Taneal's solution to use it in my already existing validations of type 'function returning error text' and it works fine.
    the problem before was that i was running 2 separate validations on the same field, and probably due to the sequence numbers, i was getting a numeric or value error. now, i've combined all validations into a single validation and it works fine.
    and honestly, i'm pretty bad with reg. ex. :D

  • Sign-in quickly with a four digit number grayed out

    The "ADD" button is grayed out for the "Sign-in quickly with a four digit number" logon option. I am not part of a domain. I do not have e-mail that belong to a domain other than hotmail. How do I turn this option back on. 
    SOmethings I have tried:
    I did go to gpedit.msc to turn the group policy "Turn on PIN sign in" to "Enabled"
    Does not seem to work. Any help appreciated please.
    Krish.

    Hi,
    "I am not part of a domain. I do not have e-mail that belong to a domain other than hotmail."
    What's the meaning? Did this computer join the domain?
    Please logon with that Hotmail account, then navigate to the following location
    Computer Configuration\Administrative Templates\System\Logon
    In the right side pane, double click on Turn on PIN sign-in and make sure it is enabled.
    After that, restart to check the result.
    Karen Hu
    TechNet Community Support

  • Check For Line Feed

    hi again, im trying to check for a line feed character in an xml file.
    im using the following code:
    NodeList nodeList = ElementNode.getChildNodes();
    for(int i = 0; i < nodeList.getLength(); i++) {
                        if(nodeList.item(i).getNodeValue().equals("\n")) {
                             System.out.println("Line Feed!");
                        }else
                             System.out.println(nodeList.item(i).getNodeName());
                   }For some reason it never prints out "Line Feed!"
    i used a transformer object to indent my xml like so,
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                   transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");so im wondering why am i not picking up the line feeds?
    many thanks

    ive found out what the line feed character is, but when im trying to read back in my xml,
    i have it indented to 4 places (see above), this will no doubt add 4 white spaces to different parts of the xml, as well as new line characters.does it also add carriage returns?this is causing me problems reading back in.Is there any classes i can use to remove all the white spaces, new line characters etc.. so i can just get at the xml content (elements, CDATA, comments etc..)?
    many thanks!

  • Check for Updates does not work.

    I have SQL Developer Version 3.0.04 Build MAIN-04.34
    When I check for updates it's failing with this error
    java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1290)
         at java.net.URL.openStream(URL.java:1009)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2650)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:304)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:615)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:531)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:363)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:321)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)
         at oracle.javatools.xml.esax.spi.ExtensibleSAXParser.parse(ExtensibleSAXParser.java:65)
         at oracle.ideimpl.webupdate.parser.MasterListParser.parse(MasterListParser.java:47)
         at oracle.ideimpl.webupdate.CheckMasterListRunnable.run(CheckMasterListRunnable.java:148)
         at java.lang.Thread.run(Thread.java:619)
    I'm using a Proxy, when I hit on Test Proxy button it fails to connect to login.oracle.com due to a 404. I've tried this URL with a web browser and it's also failing.
    Any workaround?
    Thanks Ramon

    Hi,
    Sorry I missed your post earlier, but I did see another similar one that resurrected this old thread:
    Re: Error when using Check For Updates
    Apparently no progress yet on this, but since only the refresh list of update centers fails, you can try manually adding the standard Update Centers to the Search list on Step 2 of the wizard:
    Oracle SQL Developer
    http://htmldb.oracle.com/pls/otn/f?p=raptor:updates
    Internal SQL Developer Updates
    http://raptor.oraclecorp.com/builds/updates/updates.xml
    Oracle Extensions
    http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162031.xml
    Third Part SQL Developer Extensions
    http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162033.xml
    Hope this helps,
    Gary
    SQL Developer Team

  • I can't seem to download anything on my iTunes when I use Check for available downloads. I have preorders that I can't download cos it just says 'iTunes store temporarily unavailable' even tho when I actually go on iTunes itself it work fine..

    I've been in contact with Apple support team regarding this issue. I have about 9 items available for download(preorders mostly) but it's not listed under download. When I click on Check for available download, a message with 'iTunes temporarily unavailable' appears but when I go to the iTunes store itself, its working just fine. I've already been charged twice for the same movie which Apple have kindly refunded me for one of them but I still haven't managed to download that movie yet. Apple says its a problem with my computer and given me all sort of ways to rectify the issue and still no hope. Everything else seems to work just fine including the actual iTunes store, wifi syncing and cable syncing etc. Can somebody help me with this if you know how to solve this problem or if you've had the same issue now or before?
    I am using the latest Software updates on my iTunes and these 9 items were purchased whilst on this new updates

    Launch iTunes on your computer.
    From the menu bar click iTunes > Preferences then select the Advanced tab.
    Click Reset warnings and Reset cache
    Click OK.
    Restart your computer, launch iTunes.
    Click Store > Check for Available Downloads...

  • Cancel Date in Void Checks for Payment

    Ver. 2005, PL11: The cancel date (and update date) is not being set when voiding a check for payment which is associated with an outgoing payment.
    Likewise, the cancel date (and update date) is not being set when a check for payment is voided when canceling an outgoing payment.
    When reporting on payment activity, the ocho file is not accurate without the cancel date. Any idea if this is a setting? A bug? Fixed in 2007? Ideas on a work-around?

    Ad-hoc payments, such as a cash on delivery order, an emergency employee loan or some other one-time payments are created using the check for payment screen, entered against an account number, not a vendor, and the "create journal entry" box is checked.
    The check is then immediately printed using the document printing. The payment wizard is invoked weekly, and it ignores these ad-hoc, paid and printed payments.
    Any ad-hoc checks for payment correctly have the cancel date and update date updated when using the void check for payment screen.
    Checks for payment created from the payment wizard (which are "associated" with a previously created outgoing payment) do not have the cancel date and update date updated in the check file (OCHO) when using the void check for payment screen.

Maybe you are looking for

  • Spry Collapsible panel and ul

    I've got 5 spry collapsible panels in a page, each panel with <ul>'s inside them. Now whats happening is when you click to open a panel the <ul> is appearing and overlapping all the other panels while the panel is opening, rather than gradually appea

  • Exporting Text Movie

    I've created a continuously scrolling text track in Quicktime which is to be played as an (1440x1080 / 1280x720) movie by itself, not imposed on a video track. I have too much text to work with easily in programs like LiveType. I've got pretty much e

  • When I open Contacts file in Applications a dialog box states "All Contacts (no cards)"

    When I open Contacts file in Applications a dialog box states "All Contacts (no cards)" My contacts are still located on the computer because I can still send emails as the contacts address is show as soon as I start to enter the name. Therefore I am

  • Account suspended unable to release?

    Yesterday I turned the auto recharge off and then on again and today I found my Skype account suspended. I talked on live chat and I had to provide details etc. I still do not have my account release and this is an outragious practice. Did you do it

  • What are requirements for Final Cut Express HD 1.2.1 ?

    OS X 10.4.11 okay?