Deleting extra characters

Is there a way to delete extra characters in a StringBuffer after the first occurance? For example, if I wanted to delete all comma's after the first occurance in a string, this seems to work:
          if(custName.lastIndexOf(",") > custName.indexOf(","))
               custName.replace(' ,' , ' ');
But how would you do this in a StringBuffer? I have tried using something like this:
int numComma = 0;
for(int i = 0; i < letter.length(); i++)
if(letter.charAt(begin) == ',')
     numComma ++;
if( letter.charAt(begin) == ',' && numComma > 1)
     letter = letter.deleteCharAt(begin);
but it deletes all commas, including the first occurrance..Would you use the same approach to delete extra spaces between words?[if there is more than one space] Any suggestions would be appreciated..

if you use java.util.stringtokenizer you can tokenize by your delimiter.

Similar Messages

  • HELP!  I saved a document.  Copied the document.  Went to delete some extra characters.  Accidentally deleted the entire document.  Now I can't find my document.  When I open the saved document, the page is blank.  Does Pages save copied text anywhere?

    I saved a document.  Copied the document.  Went to delete some extra characters and accidentally deleted the text of the entire document.  I did not save a blank page.  I cannot recover the lost text.  Please Help.  I'm NEW to Pages. 

    Hi Jan,
    Copied text (or other copied material) is on the Clipboard, but only until you copy something else or log out of your account. If you act before doing another copy, you can paste the copied material back into the document. If you don't act right away, you may still have a path back.
    One of the most useful keystroke combinations on the Mac is the "Oops! key," as a friend of mine once named it. That's command-Z, also known as "Undo". In some applications it will let you undo only a single step, but in others, including Pages, you can do repeated undos, so it's not quite so essential that you act immediately on making an error. Undo, done via the Oops! key, or via the Edit menu takes you back one change at a time. You can't skip any steps, so to get back to the state before the accidental deletion, you'll have to undo any work you've done since then. The memory of what to Undo disappears when you close the document or quit the application.
    At that point you're at the mercy of your backup plan. If you've had Time Machine running, you'll be able to enter Time Machine and go back to an earlier, saved version of the file.
    All these are in addition to the steps Ian suggested above.
    Regards,
    Barry
    PS: Best piece of advice I can give a new Pages user (beyond Backup early and often) is to download and read through the first few chapters of the Pages '09 User Guide, available through the Help menu in Pages '09. Mostly pretty easy reading, and will get you through the basics without much trouble.
    B

  • Technical issue SAP F110 related issue. getting extra characters in outgoing file from sap.

    Hi Technical guru's,
    SAP system creating a outgoing file through F110- t-code, this outgoing file has extra characters (DOC.NO:)
    We need to remove these extra characters. Once Payment run has been carried out through F110, in SM37 in job spool it is showing like screen attached with name “file from sm37”.
    But when we look in to outgoing file directory extra characters as I mentioned above is appearing below is the related screen attached with name “out gooing file”.
    Gurus can anyone please suggest me where I can check about this. I have checked the program available in the job as well in the F110 transaction.But could not find any hint.
    Programs which I find in SM37.
    SAPF110S
    SAPFPAYM_SCHEDULE
    RFFOSE_B
    Programs which are available in F110.
    RFFOAVIS
    RFFOEDI1
    RFFOSE_B
    Does extra  characters coming through functional configuration (DME configuration) or coming through SAP standard programs.
    I am Technical person. I need to solve this issue guys please help me in this.
    If above information is not sufficient  let me know what are the other information should I provide.

    I didn't get any resolution so far also I can't convert into Adobe form because this is a production issue which should be fix by making the requied setting or changes in SAP script itself we can't go for new developmet for this isuue.

  • BUG: Extra characters at the end of attachment file names

    I received complaints that my attachments didn't open on the PC's of the recipients. After I saw the messages I noticed there were extra characters at the end of their file names. That's why they wouldn't open. When I looked into my sent mail folder it was there as well. The addition took place when I sent the mail, while composing everything looked fine. It took me a while to realize the pattern. There was one extra for every non-ASCII character in the file name.
    Apparently Mail.app is using two different libraries. The other one counts the non-ASCII characters as two while the other doesn't. I don't know whether Finder still uses MacRoman or Unicode, but this seems to relate to double-byte characters.
    The short term solution is to use only ASCII for file names, but that's not what OS X is all about.

    The class files are broken. Recompile them. If you're uploading them, doublecheck if the FTP program used doesn't do mad things with binary files.

  • **Error** Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax error: extra characters found after end of program.

    Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax
    error: extra characters found after end of program.
    I am new to importing classes and I have been practicing
    making a photo gallery. I am stuck and I want to know if someone
    can help me with the error I am getting.
    If it is convenient, you can download and test my .zip at
    www.dhtmlguy.freeservers.com
    Thanks in advance!

    thanks...the small stuff gets me every time.

  • Extra characters at end of line in spool file

    I am trying to generate csv files from SQL Developer using queries written to spool files.  I have embedded the queries and associated set commands in script files and call them, as advised elsewhere.  This gives csv files that look fine, with headings and data comma separated and enclosed with double quotes.  The problem is that the files seem to contain a lot of extra characters at the end of each line.  They seem to be spaces, but not sure.  This is causing problems for the person trying to load the data.
    I'm using version SQL Developer 3.1.07.42, Java 1.6.0_11.
    Any ideas on how to avoid the extra spaces appearing?  Thanks for any help.
    Ben.

    Jeff,
    The SQL in the script file is below.  To be honest, I have reduced it down to a simple select from dual and it still puts extra spaces at the end of the single line.
    col ord noprint
    spool test.csv
    SELECT  ' ' ord,
      'ZONE_ORDER_NUMBER'||','||
      'ZONE_NAME'||','||
      'ZONE_TYPE'||','||
      'DESCRIPTION'||','||
      'START_DATE'||','||
      'END_DATE'
    FROM dual
    UNION ALL
    SELECT zone_name ord,
      '"'||zone_order_number||'"'||','||
      '"'||zone_name||'"'||','||
      '"'||zone_type||'"'||','||
      '"'||description||'"'||','||
      '"'||TO_CHAR(start_date,'DD-MON-YY')||'"'||','||
      '"'||TO_CHAR(end_date,'DD-MON-YY')||'"'
    FROM zones
    ORDER BY ord;
    spool off

  • Convert PDF font ITCFranklinGothicStd-MdCd add extra characters with CR2008

    My customer has several reports that are used the ITCFranklinGothicStd-MdCd font.
    We've had some users tell us that their reports are showing extra characters - specifically, it inserts the letter "i" after every lower-case "f". For example, 'Ref.' becomes 'Refi' and 'For' becomes 'Fior' (there's no letter "i" inserted after the capital "F" - it only inserts after lower-case).
    We've determined that the problem is due to the fact that we're using the ITCFranklinGothicStd-MdCd font; if we use a different font, it works fine. Also, if the end-user copies text from the generated PDF and pastes it into another document, it renders the correct spelling. So for example if they copy "Fior" out of the PDF and paste it into Notepad, it shows "For" as it normally should.
    We cannot change the font, but we should solve the problem.
    Use Crystal Report 2008 and Adobe Acrobat 9.
    How can I solve?

    Hi Ivan,
    This seems like it's PDF issue. You said "So for example if they copy "Fior" out of the PDF and paste it into Notepad, it shows "For" as it normally should."
    This suggests to me that PDF is having problem rendering that font.
    Do they have a TTF version of that font?
    What happens if you export to Word format, do you see it correctly?
    You may want to post your question to Adobe's forum and possibly the the makers of the font also.
    Thank you
    Don

  • My backspace key delete two characters in Firefox.

    My backspace key delete two characters in Firefox. How may I solve this problem?
    It works in other programs such as Office well. My OS is WIN7.
    Please help me.

    Application Basics
    Name: Firefox
    Version: 29.0
    User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
    Crash Reports for the Last 3 Days
    All Crash Reports (including 1 pending crash in the given time range)
    Extensions
    Name: Adblock Plus
    Version: 2.6
    Enabled: true
    ID: {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
    Name: IDM CC
    Version: 7.3.73
    Enabled: true
    ID: [email protected]
    Name: Right Inbox
    Version: 1.0
    Enabled: true
    ID: {eb692b9a-0dce-45fa-b0e6-765d83e386bd}
    Name: Adobe Acrobat - Create PDF
    Version: 1.0
    Enabled: false
    ID: [email protected]
    Name: PDF Architect Converter For Firefox
    Version: 1.0
    Enabled: false
    ID: [email protected]
    Important Modified Preferences
    browser.cache.disk.capacity: 358400
    browser.cache.disk.smart_size_cached_value: 358400
    browser.cache.disk.smart_size.first_run: false
    browser.cache.disk.smart_size.use_old_max: false
    browser.places.smartBookmarksVersion: 6
    browser.sessionstore.upgradeBackup.latestBuildID: 20140421221237
    browser.startup.homepage: www.google.com
    browser.startup.homepage_override.buildID: 20140421221237
    browser.startup.homepage_override.mstone: 29.0
    dom.mozApps.used: true
    extensions.lastAppVersion: 29.0
    network.cookie.prefsMigrated: true
    places.database.lastMaintenance: 1399615634
    places.history.expiration.transient_current_max_pages: 104858
    plugin.disable_full_page_plugin_for_types: application/pdf
    plugin.importedState: true
    privacy.sanitize.migrateFx3Prefs: true
    storage.vacuum.last.index: 0
    storage.vacuum.last.places.sqlite: 1399534769
    Graphics
    Adapter Description: ATI Mobility Radeon HD 5470
    Adapter Drivers: atiu9p64 aticfx64 aticfx64 atiu9pag aticfx32 aticfx32 atiumd64 atidxx64 atidxx64 atiumdag atidxx32 atidxx32 atiumdva atiumd6a atitmm64
    Adapter RAM: 1024
    ClearType Parameters: Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 300
    Device ID: 0x68e0
    Direct2D Enabled: Blocked for your graphics driver version. Try updating your graphics driver to version 10.6 or newer.
    DirectWrite Enabled: false (6.1.7600.16385)
    Driver Date: 1-22-2010
    Driver Version: 8.692.1.0
    GPU #2 Active: false
    GPU Accelerated Windows: 1/1 Direct3D 9
    Vendor ID: 0x1002
    WebGL Renderer: Google Inc. -- ANGLE (ATI Mobility Radeon HD 5470 Direct3D9Ex vs_3_0 ps_3_0)
    windowLayerManagerRemote: false
    AzureCanvasBackend: skia
    AzureContentBackend: cairo
    AzureFallbackCanvasBackend: cairo
    AzureSkiaAccelerated: 0
    JavaScript
    Incremental GC: true
    Accessibility
    Activated: false
    Prevent Accessibility: 0
    Library Versions
    NSPR
    Expected minimum version: 4.10.3
    Version in use: 4.10.3
    NSS
    Expected minimum version: 3.16 Basic ECC
    Version in use: 3.16 Basic ECC
    NSSSMIME
    Expected minimum version: 3.16 Basic ECC
    Version in use: 3.16 Basic ECC
    NSSSSL
    Expected minimum version: 3.16 Basic ECC
    Version in use: 3.16 Basic ECC
    NSSUTIL
    Expected minimum version: 3.16
    Version in use: 3.16

  • Deleting forwarding characters in an e-mail when menu feature has no effect

    Friends:
    How do I delete forwarding characters in an e-mail when option-commend-' doesn't have any effect? Yes, I'm actually in an editable window.
    Using latest version of Apple Mail on OS X 10.5.8
    Thanks,
    Migs

    Extensions
    Produtools Manuals 2.1 Community Toolbar 3.21.0.1 ({b2bf7b3f-bf0b-4c48-aec6-f92c51be63e1})
    Open the Add-ons Manager by
    Pressing the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by; '''Tools > Add-ons.'''
    Hot key; '''<Control> ''(Mac: <Command>)'' <Shift> A)'''
    On the left side of the page, select Extensions.

  • Hyperlinks created in CS6 introduce extra characters

    I've noticed that when I create hyperlinks in InDesign CS6 (v 8.0.1) it adds extra characters in the URL, thus breaking the link. For example [red highlights problem areas]...
    Correct hyperlink typed into InDesign:
    http://portfolio.epri.com/ProgramTab.aspx?sId=ENV&rId=220&pId=6931
    InDesign renders the URL this way:
    http://portfolio.epri.com/ProgramTab.aspx%3FsId%3DENV%26rId%3D220%26pId%3D6931
    This happens on both a Mac and a pc. I never experienced this problem in earlier versions of InDesign.
    I found an earlier discussion about this problem but it doesn't appear that Adobe has fixed it. A corrective script was offered by Laubender in that discussion. However, I create a lot of docs with a lot of links and would rather avoid that type of solution.
    Any suggestions would be much appreciated.

    Use laubender's script solution. It is the most straightforward fix.
    http://forums.adobe.com/message/4463255#4463255

  • Contacts notes still have extra characters

    No device
    I have a pre that's 2 yrs old.  I have been reading that the extra characters  < br / >  issue is known; in fact 2 other posts from 2010 were closed.  I still have this problem; I added a contact 10 minutes ago and notes still added extra characters.  The extra characters have never gone away since arriving a year (?) or more?  any help coming?

    Hmm...
    OK - I just went into icloud settings on my iphone and figured I would toggle off the notes, back out and then go back and toggle notes back on... this was the one set of data that wasn't critical if I list it. 
    Notes came back, reminders are now back and contacts are now back... Still would love to know why these all disappeared in the first place.  All seems to be back to normal though. 

  • Delete extra spaces in table column

    hi how can i delete extra spaces in table column for example if table column value is store as 'ÄAAAAA ' how can i delete that extra space
    this is the column i what to delete extra spaces
    select SUBTYPES  from tablesubtype;am in
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Edited by: adf0994 on 2012/12/03 11:30 AM
    Edited by: adf0994 on 2012/12/03 11:42 AM

    UPDATE tablesubtype
       SET SUBTYPES  = TRIM (SUBTYPES);Doing RTRIM alone will not suffice coz it'll only remove Right Spaces and NOT Left ones.
    I guess, in your case doing a TRIM will be more beneficial to be safe and prevent any left spaces in future.
    For intermediate spaces... try this.
    UPDATE tablesubtype
       SET SUBTYPES  = REGEXP_REPLACE (SUBTYPES, ' ', '');Hope this Helps,
    Ranit B.
    Edited by: ranit B on Dec 3, 2012 2:33 PM
    -- added regexp

  • Add hyperlink in mail is adding extra characters to URL

    When I paste the add a hyperlink to a page called Recent News on my .mac site, extra characters are added to the url causing the page not to be found.
    "...Site/Recent%20News/D3A....html" becomes "...Site/Recent%2520News/D3A....html". I have no problem adding a hyperlink for my welcome page. Any ideas?

    I don't know how to fix it, but I can at least tell you what's happening. The "%20" is the encoding for a space character in a URL, " ". This is being turned into "%2520" because the "%" is being encoded as "%25" (the encoding for "%" in a URL), so "%20" is turning into "%2520".

  • Extra characters appearing in Stickies and TextEdit

    Having a problem with the design computer at work. Font issues all over the place. For instance, I'm trying to type into this field, and my cursor isn't exactly lined up with the text... so I don't really know where I am . It's inserting extra characters and spaces into the text field. This is happening on Stickies and TextEdit... and not anywhere else... not with Mozilla Thunderbird or MS Word. Weird.. Also the font is very light... as If I'm missing a core font.. which is possible because I used FontExplorer X (from LynoType) to clear the font cache and remove fonts from the system folder than weren't installed by Apple. I t may have screwed up the font folder... I might need to reinstall fonts, but I don't want to reinstall the system if I can avoid it. Any suggestions?
    Dual 2GHz PowerPC G5   Mac OS X (10.4.9)  

    Hi wlp165,
    Try printing the Word Doc to Adobe PDF printer and then check the issue.
    Or would it be possible for you to share the document.
    I sent you private message for sharing the document.
    Regards,
    Anoop

  • Permitted extra characters in BW

    Hi,
    we are loading material master data and get an error message:
    Charachter µ (lower case Mu) is not permitted. We are on BW 7.0.
    We didn't have any problem with BW 3.5 as we have maintained it in permitted extra characters in RSKC. I tried to copy extra characters (RSKC) from BW 3.5 in BW 7.0, but it doesn't work for Charachter µ (lower case Mu). It makes a capital M in RSKC in BW 7.0
    Any suggestions.
    Thanks

    In a UNICODE system it's doing the right thing. Remember that Mu (character µ) is M in the Greek alphabet, so the system is "translating" the character µ from Greek to M in English (capital M as you may have ALL_CAPITAL in your RSKC settings. This will also happen for ? (ALPHA) as A in English or ? (Beta) as B in English.
    Now the symbol µ was taken for the Micro symbol in the 255 ASCII table (non-UNICODE systems) so there's a "confussion" between the letter MU in Greek (UNICODE 03BC) and the Micro symbol (UNICODE 00B5).
    Try customizing the program to interpret 03BC to 00B5 or you may set the RSKC to ALL_CAPITAL_PLUS_HEX.
    Hope this works.
    Jesus
    Edited by: Jesus Cova Graffe on Feb 19, 2008 4:03 PM

Maybe you are looking for

  • ITunes multiple users on PC

    Ok, I have looked all over and still not quite understanding what I need to do. I use a PC and just recently received an IPod Nano for Christmas. My computer is not here, I just moved. So I am using my roommates computer. He has ITunes set up for his

  • New bie problem System in read

    freinds i recently downloaded an ebook n I HAVE 1 QUERY IF any of U COULD DEBUG THAT TOO I would REALLY BE A HAPPY MAN friends WITH BELOW MENTIONED CODE, PROBLEM IS THAT WHEN USER ENTERS SUPPOSE 1,48 AUTOMATICALLY GETS ADDED TO IT N WHEN I SUBTRACT 4

  • How to load flat file in BPS through Web-debugging

    Hi, We are working on flat file upload in BPS thru guide 'How to load flat file in BPS through Web'. Can some one guide on how to debug the function modules used while uploading the data. We have set up the break point in the function modules and als

  • Site check in IE 6 and other browsers?

    I would really appreciate it if someone would check this draft page/site with IE 6, in particular. We're looking for display problems - elements overlapping, displaying in ways they obviously shouldn't be, looking downright bad for any reason. (We're

  • Can we post zero dollar invoice (AP)

    Hi I have come across a weired situation. We need to clear the GRIR balance and to clear the quantity, we want to process the dummy invoice with zero dollar.Is it possible ? My system does not allow that. Thanks in advance