How to delete excessive spaces for a string??

like String s="i am a new guy"
how to make it to "i am a new guy" ??
i've tried trim() seems it does work for this case
thanks

oh......no i typed several spaces symbol between "i"
and "am" in the first sentence, but this forum seems
ignore those blank spacesIt doesn't if you use code tags. And it's not the forum, but HTML standard.
so what i am trying to do is. what if there are say,
100 spaces between two words in a sentence (string)
and i want to delete the excessive space and make it
just one space between two wordsThen trim() doesn't do what you want it to do. As the documentation clearly describes. Use replaceAll.

Similar Messages

  • How to delete table content for particular filed in a table?

    Hi Experts,
    How to delete table content for particular field in table?
    Thanks
    Ravilla

    Is it a standard or customer table, changing a standard table with non-standard tool can raise database inconsistencies...
    Then use search tool for &SAP_EDIT (*) or look for BAPI/BDC...
    Regards,
    Raymond
    (*) Also look for notes from 1420281 - CO-OM tools: SE16N: Deactivating &SAP_EDIT to 1915828 - CO-OM-Tools: Technical enhancement of SE16N

  • How to delete the Infoobjects for a particular dimension?

    Hi,
    How to delete the Infoobjects for a particular dimension?
    ( when i was trying to delete dimensions it is saying that the dimension contains infoobjects , u can not delete the dimension, what 2 do?)
    Thanx in advance,
    Ravi.

    Ravi,
    If you want to remove the Infoobject from Dimension then you need to delete the data from the cube and then remove the infoobject from that particular Dimension. I mean delete the assignment for that Infoobject.
    Assign Points if it helps..
    Incase if you need more help.. Please call me..
    Gattu

  • How to use execute immediate for character string value 300

    how to use execute immediate for character string value > 300 , the parameter for this would be passed.
    Case 1: When length = 300
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    length : 300
    PL/SQL procedure successfully completed.
    Case 2: When length > 300 ( 301)
    SQL> set serveroutput on size 2000;
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 6

    result varchar2(300);Answer shouldn't be here ? In the greater variable ?
    Nicolas.

  • ALV: how to save context space for large tables ?

    Dear collegues,
    We are displaying an ALV table that is quite large. Therefore, the corrsponding DDIC structure and the WD context is large. This has an impact on performance and the load size of the program. Now we will enhance the ALV table again.
    Example: for an icon and its explaining tooltip that are displayed in the ALV: there is are context fields required like "SOURCE_FIELDNAME" for the tooltip as well as for for the icon. They need a lot of characters for each tooltip and icon).
    Question: do you have an idea, how to save context space for those ALV fields ?
    Best regards,
    Christian

    >We are displaying an ALV table that is quite large.
    Do you mean quite large as in a large number of columns or as in a large number of rows (or both)?  I assume that the problem is probably more related to a large number of rows.  For very large tables, you should consider using the table instead of the ALV. For very large tables you can even use a technique called context paging to keep only a subset of the data in the context memory at a time.  Here is a recent blog that I created on the topic with demonstrations of different techniques for table sharing, shared memory, and context paging when dealing with large tables in Web Dynpro ABAP:
    Web Dynpro ABAP: How Fast Can You Consume 1 Million Rows?

  • I have an iPad and want to know how to delete email addresses for those that I have sent email to.

    I have an iPad 2 and want to know how to delete email addresses for those that I have sent mail to.

    Email addresses that are not in your Contacts app but which still show up in Mail will disappear after a period of time when they are unused. Just ignore them and they will eventually go away.

  • Delete white spaces between two strings

    hi!
    How do I remove white spaces between two strings. I have attached file for reference.
    Thanks
    Attachments:
    untitled4.JPG ‏62 KB

    You first need to define what you consider to be "whitespace". Is it just a space? Is it spaces and linefeeds? What about carriage returns? Tabs? Anything non-alphabetic and/or non-numeric?
    As mentioned previously, the Search and Replace String can be used to delete characters by wiring an empty string to the replace string input. The following, for example, will delete all spaces:
    If you need to delete other whitespace characters, just call it again on the resulting string.
    Message Edited by smercurio_fc on 06-02-2008 09:25 AM
    Attachments:
    Example_VI1.png ‏3 KB

  • How to delete all objects for one user from SE80

    Hi all,
    If i want to delete the customer objects defined in the customer space Y or Z from SE80. Object of one user is defined in one package, if i want to delete the pakcage it says, it contain the subobject. So can anybody help me how to delete the customer objects from SE80.
    Your response will be highly rewared.
    Tahnks,
    Salahuddin.

    hi
    good
    i think here you want to delege the development class, if you want to delete the particular development class you have to go for se09 where after selecting the particular development class you can select the delete button.
    thanks
    mrutyun

  • How to delete last character in a string

    Guys i have a question...
    how can i delete the last character in a string..
    for example
    String myString = "helloWorld, ";
    how do i delete the last character in this string which is a "," ?

    String newString = myString.substring(0, myString.length()-1);

  • How to delete the index for the business object BUS0033

    Hi to all experts,
    I'm applying note 1349496 the error here is no records with F4 help for the funds center .
    solution from the note
    Implement the attached program corrections. Then, in the transaction, delete the index for the business object BUS0033, reactivate it, and start the indexing in the indexing mode "Full". The system then displays the data correctly in the F4 search help.
    how to do the second part i have already applied the note .

    any help

  • How to delete the line for 300SAP* in table USR02 in SQL Management studio

    Hello
    I used to delete the line for 300SAP* in table USR02 in SQL Enterprise Manager. After I could log on with “pass”.
    I wander how to delete it in SQL Management studio. When I expand tdatabase it takes so long time and it is uncontrollable

    Hello,
    you have to delete the row by a sql statement.
    Open a new query and run a script like this:
    use <Your SID DB>                 -- e.g. use PRD
    setuser 'your sid in lowercase'  --- e.g. setuser 'prd'
    delete from USR02 where MANDT = '300' and BNAME = 'sap*'
    go
    Run a complete backup before deleting data manually.
    Regards
      Clas

  • Urgent: How to Delete all Cards for a Crawler through SQL

    Folks,
    Good morning! I am trying to delete 2 million cards (should have been expired, and makes the search index rebuild take days) in a single folder in the Knowledge Directory in the 6.1 portal. The job to delete the folder ("Apply Later") has been running half of yesterday and then all night with nothing being logged in PTSpy or the joblog, little or no CPU activity.
    Does someone have a DB query that can zap the cards for this crawler? I know how to select the cards for a particular crawler ID, but don't understand how to delete them properly such that all references to those cards in other tables also get removed.
    Much appreciate !!!
    Cheers!
    Edited by: Plumtree on Jan 21, 2009 7:28 AM (fixed an 'oops')

    You obviously are looking for someone who has done and tested this before, which I have not...but when I delete a folder the following happens for each card:
    delete from:
    PTFolderCards
    PTCards
    PTCardProperties
    PTCardSecurity
    PTCardStatistics
    PTMigration
    update:
    PTInternalCardInfo (RefreshDate = null, ExpirationDate = null, RefreshRateUnits = null, RefreshRateNum = -1, MissingDeleteUnits = null, MissingDeleteNum = null)
    PTCardStatus (indexing status set to 3)

  • How to Delete unwanted Apps for ever?

    Sometimes we download 'apps', which may turn out just duds or NOT as good and functional as we expect them to be. Then we decide to delete and though they are deleted from iPad ( 4th Gen) or iPhone, the same remain in the iTunes and show up at the time of synching under App section.  The "Remove " option works only for deleting an app available on the device but not from iTunes ( computer) apps section. How can we Delete unwanted Apps for ever?
    Sometimes I wonder why Steve infused so mauch control into such mundane issues as deleting undesirable stuff?It irritates to the extent sometimes I feel, whatever is said Windows based OS is much more user friendly and truly functional...

    kilpauk wrote:
    The "Remove " option works only for deleting an app available on the device but not from iTunes ( computer) apps section.
    Have you tried Control-Clicking on the offending app?
    Followed by a click on Delete?

  • How to calculate storage space for archive log files and database backups?

    Hi all,
    I have a 1.8 terabyte Oracle 9i database and need to plan for how much additional disk space I will need to perform nightly backups and for archivelog files. Is there a script or formula available that can help me estimate how much required disk space I will need to hold a days worth of archived logs as well as a nightly export dump file and a full hot RMAN backup on disk?
    Thanks!

    I'm not sure how to estimate the size of your backups, especially if you use incrementals. However, the space required for archive logs will be equal to the amount of REDO your DB generates. I would count the number of log switches per day with a query like the following:
    select trunc(first_time), count(*)
    from v$log_history
    group by trunc(first_time)
    I would then take the average and multiply this count by the size of your redo log files (assuming they are all the same size).

  • How to select color space for PDF export in Aperture 3

    If you're exporting a book layout as a PDF for printing by a third-party album company, you may need to specify sRGB as the color space for images in the PDF. That's OK if your book is composed of JPEGs that are already in the sRGB color space. But, if your images are RAW, Aperture will export them into PDF using the Adobe RGB color space by default. Sending aRGB images to an sRGB printer will result in flat, unsaturated colors, as I learned the hard way. Apple tech support was unable to tell me how to handle this, but I stumbled on the answer myself. Select the book in the Library pane. Select File > Print Book. In the resulting printer dialogue window, pull down the Color Profile menu (default: No Profile Selected) and select sRGB or whatever target color space you desire. Then, click the PDF button and select Save as PDF. Presto! Your PDF images will now be in the appropriate color space.

    Hi again, here some updates.
    the issue is still there.
    From Aperture, I tried to export to PDF the single images, and they look good (no posterization).
    Furthermore, I created a photo book from iPhoto with the same pictures, and exported it to PDF. It also looks fine.
    Also opening/exporting to PDF from photoshop does not show any problem.
    The problem occurs only if I try to print the book from Aperture (option "print book" -> "save as PDF"), or if I make a book preview before placing the order (I suppose it's the same action).
    Is anybody aware of what exactly Aperture does in these particular cases?
    Please consider that:
    1. my monitor (iMac 24") is hardware calibrated
    2. the source pictures are in RAW (so no color profile on them) and (just a couple) in TIFF (16bit, Adobe RGB). I also tried reimporting in the album jpg converted versions, with no better results.
    3. OS and Aperture are updated to the latest versions.
    This problem is blocking me from placing the order...
    Someone could give some help here?
    thanks in advance
    marco

Maybe you are looking for

  • Networking with a Windows 7 PC

    I have never done this in OSX, however I did this all the time in OS 7-9.x and the process seems different. In those days one need Thursby's Dave to do this, but these days its all built within the OS. Okay so lets say I only want to share one file h

  • E71 wifi connection works in browser, but not with...

    I need help badly. On my Nokia E71 I can easily connect to a wireless network and browse the web from the browser. But when I try to read my Gmail from the mail client on the phone I get an error message "Unable to connect to e-mail server". The sett

  • [BPC 7.0 SP3] Issue to restore a backup using the server manager

    Hello, I'm faced with a contraignant issue. I'm trying to restore a previous back up done with the server manager but I get the following error message at the "fileDB" step : "Cannot find the Appset or cannot copy files" with a red cross "FileDB : Fa

  • Setting background photo on macbook (osx 10.4.11)

    if i find a photo i like on google images and would like to set it as a background photo on my desktop macbook, how do i do that? how do i set any photo i like, as background (whether emailed to me, in my iphoto library, or from the internet)? thanks

  • Gogle Adsense Not Showing In Browser

    Hey All, I have tried everything to fix this and unfortunately I am at a loss. I signed up for a Google Adsense Account and using iWeb I added the code using the html widget. I can see my adds on every PC and Mac other than mine. I do not have adbloc