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!

Similar Messages

  • How to remove space after paragrph in pages on ipad

    Can't figure out how to remove space after each paragraph in Pages for Ipad

    Settings > General > International > Region Format
    Set it to your country to format numbers and dates in the way your country does.

  • How to remove space below text?

    In the screenshot below, how to remove space below text? I simply added a text box using the type tool and I get that extra space bellow the letter "B" that I don't need. I want to remove that space to center the letter within the octogon.
    Thanks!

    You might consider giving the letter a negative baseline shift and aligning it to centre.
    That way you can adjust it so that its anchor point coincides with the centre of the hexagon.
    Like this:
    Another thing: You may find it easier working with type if you hide bounding boxes.

  • How to remove space from a variable in a smartform

    Hi,
    I have a problem in displaying a variable in a smartform..The variable shows some blank space that preceeds the data.
    for eg:,
    variable =        18.000.
    How to remove space before 18.000?

    To remove the decimal places for quantity and rate/quantity , use the syntax to restrict the number of digits after decimal places. The syntax is
    &symbol(.N)&
    where N is number of decimal places.
    Since you dont want decimals use &symbol(.0)&
    For the other case it depends on how the currency is represented , any way try using the syntex &symbol(T)&
    Please give me reward point If it is useful
    Thanks
    Murali Poli

  • How to remove space below the table in smartforms

    how to remove space below the table in smartforms

    maintain a loop counter for item say count
    and in text editer write
    if count > 6
      new-page.
    endif.

  • How to remove Space

    Hi  group,
    I have one string with length 15 ,sometimes I am getting this fields with in between sapces and hyphen(-) ,how to remove these spaces and hyphen using JAVA in UDF.
    Can any suggest

    So is what you want some thing like pass all the numeric values in the 15 character long string..is it ?
    if yes please use this code in UDF...
    int len = input.length();
    String output = "";
    for(int i = 0; i < len; i++){
      if(Character.isDigit(input.charAt(i))){
        output+= input.charAt(i);
    return output;
    Thanks,

  • 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

  • How to delete Spaces in String

    Can somebody help to modify my source, cos i want to delete certain space. Thanks
    private static String printStar(int SpaceForStar){
        String sDelOneSpace =" ", sAddOneSpace=" ", star ="*", sTtlSpace ="";
        for(int i=0; i<numSpace; i++){
          sTtlSpace += sAddOneSpace;    
        for(int i =0; i<8; i++){
          sTtlSpace = sTtlSpace - sDelOneSpace;   // seem that not working.. can somebody help Thanks
        return sTtlSpace+star;
      }Thanks in advance
    jas

    What you are trying to do will not work - subtraction of Strings does not make any sense.
    To remove spaces, I suggest you use a StringTokenizer with space as dividing token. Lop trough the tokens and add them to a new String, like this:
        public static void main (String[] args) throws Exception {
            String withSpace = "aaa sss bbb";
            System.out.println(removeSpaces(withSpace));
        static String removeSpaces(String withSpaces) {
            java.util.StringTokenizer t = new java.util.StringTokenizer(withSpaces, " ");
            StringBuffer result = new StringBuffer("");
            while (t.hasMoreTokens()) {
                result.append(t.nextToken());
            return result.toString();
        }This will remove all spaces, and print "aaasssbbb". If you only want to remove the first or the last space, you can use indexOf() or lastIndexOff to find the space, and then substring to pick the text before and after that space and concatenate those two strings to a new string without the space:
        static String removeFirstSpace(String withSpaces) {
            int spaceIndex = withSpaces.indexOf(' '); //use lastIndexOf to remove last space
            if (spaceIndex < 0) { //no spaces!
                return withSpaces;
            return withSpaces.substring(0, spaceIndex)
                + withSpaces.substring(spaceIndex+1, withSpaces.length());
        }

  • Urgent help: How to remove the accumaltion when show movies step by step with buttons

    I want to show the movie step by step by clicking the next
    button. Inside each frame, many movie clips are generated
    dynamically at runtime, and they can be played interactively.
    I achieves the step-by-step display of those frames by adding
    another layer with the action stop(). But I got one trouble: all
    the movie clips from previous frames are accumalted. How to remove
    the accumulation from previous frames?
    For the continuous display of the movie, I tried to use
    onEnterFrame() and change the _visible property of all the movie
    clips to false in this function. But it doesn't work for the
    step-by-step display. Once I click the next button, the movie clips
    at the current frame just show very quickly, then disappear. What
    should I do?
    I need to fix this immediately.
    Your help would be greatly appreciated.
    - zcx

    you can use the removeMovieClip() method for those movieclips
    added dynamically.

  • HT4314 I don't but I have created 2 game center accounts with one apple ID and I want to remove the new account which I made so need help how to remove it

    I don't know how but I created it and want to remove now but I didn't got any option for removing account. I have unfriend all my friends which where connected to my new account and I have clicked the public profile and kept it off but I didn't find how to remove please help me with this.

    Im having the problem too, I want to play Clash of clans with my brother but when ever he tries to play, hes me;(
    CAN ANYONE HELP US!!! PLEASE!!!

  • How to remove spaces at selection screen coming from logical database

    Hi Experties,
    When we hide some selection from the logical database.  The spaces still occupied and this make our selection screen looks awkward.
    How to remove the spaces left by hidden selection ?
    Regards
    Nislina

    Hi,
    I came across your un-answered question while searching for a solution on the similer problem. Though I couldn't fine a solution on SDN, but figured out one myself. Thought its a good idea to share it.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group4 = '003'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Here screen-group4 contains the sequence number of the select-options field starting from 000 onwards.
    You may like to assign points and close the question.
    Kind Regards,
    Khalid Mustafa

  • How to remove space from satrting

    help me please
    i have 16 digit field ,  so in output i have only 5 digit and left  11 digit is comming blank
    so please tell me how to reduse space form starting
    my field is coming like this   -- Rs:            78,999.00 
    so i want to reduse space between Rs and amount
    thanks

    you can either use condense statement
    condense <field name>.
    You can also use the following function module.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        INPUT         = <FIELD NAME>
    IMPORTING
       OUTPUT        = <FIELD NAME>.

  • How to remove space before value in Excel

    Hi,
    Have to send mail with Excel attachment.
    for that SO_DOCUMENT_SEND_API1is using.
    Just concatenating data to Contentents_BIN Structure with cl_abap_char_utilities=>cr_lf to get record by record.
    But i'm getting space in seoncd record first cell along with value.same things for next records aswell.
    How to remove that space in excel attachment?

    Hi,
    Is the value right aligned? If you pass any whole number or decimal number values to the excel sheet, it will be displayed in right aligned format in excel sheet. What is the type of the value that you are passing to the excel sheet.
    Thanks & Regards
    Rocky

  • How to remove spaces

    Assignee: cf_supp Status: Open, In Progress, Reopened, Test Deployment Pending, Production Deployment Pending, Ready for QA, Bus Analysis, Ready for Development and Deployment Complete Sorted by: Created descending, then Key descending
    the above is the paragraph that i am displaying in table from query but i am not able to remove spaces in between , i tried with trim and also with replace functions.
    Any help in this
    Thanks in advance

    the above is the paragraph that i am displaying in table from query but
    i am not able to remove spaces in between , i tried with trim and also
    with replace functions.
    There's always the old trick of continually applying a replacement function until you're done. It just might be of help here. I assume you will want to stop when there is only a single space between the words.
    <!--- variable to simulate a paragraph containing arbitrary space characters --->
    <cfsavecontent variable="paragraph">
    Assignee: cf_supp Status: Open, In Progress,
               Reopened,             Test Deployment Pending,   Production
                Deployment Pending,    Ready for QA, Bus
         Analysis, Ready for Development and Deployment
    Complete Sorted by: Created descending,              then Key descending
    </cfsavecontent>
    <p>
    <strong>Paragraph before:</strong>
    <pre><cfoutput>#paragraph#</cfoutput></pre>
    </p>
    <!--- Replace whitespace characters like linefeed, carriage-return, tab, space, etc., with a single space --->
    <cfset paragraph = REreplace(paragraph,"[[:space:]]", " ", "all")>
    <cfloop condition="true">
        <cfset old_paragraph = paragraph>   
        <!--- Replace two adjoining spaces with a single space --->
        <cfset paragraph = replace(paragraph,"  ", " ", "all")>
        <!--- Continue till there is no more replacement --->
        <cfif compareNoCase(old_paragraph, paragraph) is 0>
        <cfbreak>
        </cfif>
    </cfloop>
    <p>
    <strong>Paragraph after:</strong>
    <pre><cfoutput>#paragraph#</cfoutput></pre>
    </p>

  • "urgent" pls help: How to remove name space form message in call to WS

    Hi
    I am calling a WS from my BPEL process. In the BPEL process I call the WS by referring to the URI of the WS in the partner link. The process works fine. But I have a problem with the message size. The WS does not accept Message size greater than 16kB.
    But my message some time exceeds 16kB when maximum data is handled in the message.
    Now I found that the each element in the request contains the namespace which eats up a lot of space.
    Is there a way to remove the namespace from individual elements and put it in a common place in the file? This would reduce the file size.
    I would like to bring to your notice that the WSDL of the WS that I am referring to does not have any reference of xsd. And also no XSD has been created in my BPLE process for this WS.
    Present message
    <messages>
    <InvokeCallORSNewHI_HELLO_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="parameters">
    <HELLO xmlns:ns1="http://abc.def.com/webservices/" xmlns="http://abc.def.com/webservices/">
    <ns1:HELLO_DATA>
    <ns2:HI_TW xmlns:ns2="http://abc.def.com/webservices/packets">
    <ns3:IDENT xmlns:ns3="http://abc.def.com/webservices/fields">400001102/T1-TW17902</ns3:IDENT>
    <ns3:HI xmlns:ns3="http://abc.def.com/webservices/fields">400001102/T1</ns3:HI>
    <ns3:START_DATE xmlns:ns3="http://abc.def.com/webservices/fields">20080404</ns3:START_DATE>
    <ns3:START_TIME xmlns:ns3="http://abc.def.com/webservices/fields">0800</ns3:START_TIME>
    <ns3:DURATION xmlns:ns3="http://abc.def.com/webservices/fields">1200</ns3:DURATION>
    <ns3:WINDOW_COST xmlns:ns3="http://abc.def.com/webservices/fields">1.113</ns3:WINDOW_COST>
    <ns3:LATE_COST xmlns:ns3="http://abc.def.com/webservices/fields">1.75</ns3:LATE_COST>
    </ns2:HI_TW>
    </ns1:HELLO_DATA>
    </HELLO>
    </part>
    </InvokeCallORSNewHI_HELLO_InputVariable>
    </messages>
    Expected------------
    <HELLO xmlns:ns1="http://abc.def.com/webservices/" xmlns="http://abc.def.com/webservices/">
    <ns1:HELLO_DATA>
    <ns2:HI_TW>
    <ns3:IDENT>400001102/T1-TW17902</ns3:IDENT>
    <ns3:HI>400001102/T1</ns3:HI>
    <ns3:START_DATE>20080404</ns3:START_DATE>
    <ns3:START_TIME>0800</ns3:START_TIME>
    <ns3:DURATION>1200</ns3:DURATION>
    <ns3:WINDOW_COST>1.113</ns3:WINDOW_COST>
    <ns3:LATE_COST>1.75</ns3:LATE_COST>
    </ns2:HI_TW>
    </ns1:HELLO_DATA>
    </HELLO>
    Thanks
    Buddhadev

    Dear Rico
    Thanks for replying.
    Which XSD are you refering to ;
    Is it process XSD or the XSD created for the called WSDL.
    As I have stated, no XSD has been created for the Consumed WS. And no XSD reference is present in the WSDL of the WS consumed by me.
    Please confirm
    Thanks a lot
    Buddhadev

Maybe you are looking for

  • All of a sudden my only charger for my iPad 2 won't charge. How do I fix this?

    It started by saying that the charger couldn't be supported during application, even though no apps were being run. And now it won't charger period.

  • Error while parsing SRVCTL output.

    OS : Sun 5.10 SPARC Machine DB :11.2.0.1 (Cluster Nodes) On DB Control, while checking "Cluster Managed Database Services " getting below error. Error while parsing SRVCTL output. Ensure that SRVCTL is functioning properly. I have checked the status

  • Function module in ST03N for user to transaction info

    Hi, we are running ECC 5.0 and have a requirement to find out which users have executed certain transactions in a period of time (e.g. month, week). ST03N gives these details, however, we need to run this for several transactions and multiple periods

  • Need code for 3d game or anything

    I need the code for a 3d game or anything because i want to study the code so I understand how to make something 3d.

  • Conditions segment in PORDCR102-PO create IDOC?

    Hi , Iam populating some fields in the E1BPMEPOCONDHEADER segment of the IDOC PORDCR102. But the condition record is not getting generated in the PO. Kindly can anyone throw some light on the mandatory fields that needs to be populated in this segmen