How to convert tabs between the words in a String to a single space in java

I have a string with more number of tabs in between them, the thing I need to do is that I need to convert all those tabs into a single space.
I used replaceAll(“/t”,” “); but the problem is that it was converting the tabs into spaces but if we have a 3 tabs in between 2 words then this 3 tabs are converting into 3 spaces but I need to have only one space.

user548049,
How is your question related to the topic of this forum: Oracle Database-embedded JVM?
Anyway, you need to use the greedy qualifier: +, like so:
replaceAll("\\t+"," ")Good Luck,
Avi.

Similar Messages

  • How can I do Count the Words in a cell with Numbers?

    I'm producing a documentary, with a long list of captions. I was hoping using numbers to organize the captions in sequence. them take the word count and do a simple calculation to work out the numbers of frames required per caption, based on a certian numbers of words per minute.
    I can handle calculations, but can't figure out how/if numbers can count the whole words in a cell and pass that on to a formula.
    I count them manually, but the nature of the script means the captions are being constantly updated.
    Any help appreciated!

    Clever. The only additional suggestion is to use the function Trim() just in case there are extra spaces between the words.
    =LEN(TRIM(B))-LEN(SUBSTITUTE(B," ",""))+1
    Rob

  • I would like to change the spacing between the words for the product names, they look double spaced at present.

    A simple question I think, I would like to change the spacing between the words for the product names, they look double spaced at present. On the home page, and product pages. Not sure where to change this in the css here is the site; http://top10shop.businesscatalyst.com

    That site is using an old font technology called cufon, it uses canvas to draw the text into the font you want. Not really good for modern websites.
    It is what the font was and how it was made. I never used Cufon but the documentation is here - Usage · sorccu/cufon Wiki · GitHub At a glance there are no render options for the double spacing so I am guessing it was how the font was generated.
    I would scrap all of that completely tbh.

  • I have 2 profiles on one computer. How to share music between the profiles in itunes?, I have 2 profiles on one computer. How to share music between the profiles in itunes?

    I have 2 profiles on one computer. How to share music between the 2 separate profiles in iTunes?

    iTunes: How to share music between different accounts on a single computer
    This might help. info provided by 'b noir'
    iMoz

  • My daughter and I both have an iPhone and we have shared my apple ID. Now her phone is syncing with mine and we want to have different contacts. How do I differentiate between the two phones?

    My daugher and I both have an iPhone and we have shared my apple ID. She just replaced her phone and now our contacts are syncing -- and we don't want that. How do I differentiate between the two phones?

    Is the same Apple iCloud account being accessed on each iPhone?

  • My IPhone has a different ICloud Apple ID than my iPad. How can I stream between the two devices

    My iPhone has a different id than my iPad. How can I stream between the two devices

    I should say that you can add the other account to each device as a seconday account by going to Settings>Mail,Contacts,Calendars>Add Account>iCloud and signing in with the ID the other device is using.  This would allow you to see mail, contacts, calendars, reminders and notes from the other account alongside the same data from the primary account on each device.

  • How to convert sysdate to the format dd-mon-yyyy

    how to convert sysdate to the format dd-mon-yyyy

    <how to convert sysdate to the format dd-mon-yyyy>
    This question is better answered by thinking about about how Oracle dates work. SYSDATE is a pseudocolumn (function without any arguments) that returns a date value: it already is a date. Oracle date values are stored not as we see them, say 'DD-MON-YY', but as a series of bytes with the different date components from the millennium down to the second. We NEVER see dates as they are stored but use the formats for automatic conversion.
    To display a date the way you want use TO_CHAR() with an edit mask or as others suggested change your NLS_DATE_FORMAT (thought I advise against this as most systems use DD-MON-YY and porting queries from other systems or even OTN can easily break). To change a converted string back to a date use TO_DATE() with an edit mask.

  • How to disable Tabs in the application

    Hi OAF Guys
    How to disable tabs in the application? if any one knows reply asap
    Thanks in advance

    Tabs are generated by the menu structure, if you want your page not to have tabs, have a responsibility with a menu which does not have any levels of submenus and just has your page as a function in the menu.
    Thanks
    Tapash

  • How can I distinguish between the first and the rest in Smartforms??

    I have made an Invoice in Smartform. I have to take three copies of that. In the first copy it will be printed "ORGINAL INVOICE" and in the next copies it will print "Duplicate copy".  How can I distinguish between the first and the rest in Smartforms??
    Regards,
    Subhasish

    >
    Subhasish Ganguly wrote:
    > I have made an Invoice in Smartform. I have to take three copies of that. In the first copy it will be printed "ORGINAL INVOICE" and in the next copies it will print "Duplicate copy".  How can I distinguish between the first and the rest in Smartforms??
    Hello Vamshi,
    As per the OP's requirement he has to print 3 copies of the invoice. Which according to my understanding should be printed at the same time ? May be i am wrong in interpreting this.
    You must be knowing you can control the print params of the SmartForms in CONTROL_PARAMETERS where you set the NO_DIALOG & in the OUTPUT_OPTIONS pass the number of copies.
    I think the solution you have proposed the "Original Copy" will be printed only once. (Correct me if i am wrong)
    Every time the user prints the invoice again he will be getting a "Duplicate Copy". If this is what the OP wants the logic is perfect
    Cheers,
    SUhas

  • HT204389 Can any tell me how i stop siri sayin the words i am typing when typing a message??

    Can any tell me how i stop siri sayin the words i am typing when typing a message??

    Hellooo Frndz....:)  i have to use UISplitviewController.and I want to do add UISplitViewController To UINavigationController but problem is that i can't do this...:(   i use MGSplitViewController Bt I Dont know Perfectly Use Of MGSplitViewController...
    so , plz give me answer for how to add UISplitViewController to UINavigationController ???
    --THNKS>>

  • How to convert pdf into ms-word

    How to convert pdf to ms-word?

    Here's one I tried:
    PDF Converter
    And one I didn't,
    PDF2Office Personal
    Repeat after me, "google is your friend" (at least for searching).

  • I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    Hi...
    Mac OS X keyboard shortcuts
    Control-F4
    Move focus to the active (or next) window
    Shift-Control-F4
    Move focus to the previously active window
    By the way...  since you are new to Mac, click a clear space on your Desktop. You should see "Finder" top left corner of the screen in the menu bar.
    Click Help then click Help Center
    As an example type in    keyboard shortcuts
    You can use the Help menu for almost any application on your Mac.
    Apple - Find Out How - Mac Basics
    For held switching from PC to Mac >  Apple - Support - Switch 101

  • I am new to Apple; how do i toggle between the pc and and overhead projector? Which keys?

    I am new to Apple; how do I toggle between the pc and an overhead projector? Which keys?

    Not sure how your question relates to an AirPort Extreme, AirPort Express or Time Capsule......these products:
    It appears that you have a question about a MacBook Air.  If that is the case, then please post your question in the support area for the MacBook Air linked below:
    MacBook Air

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

  • How to replace multiple occurences of space in a string to a single space?

    How to replace multiple occurences of space in a string to a single space?

    Hi,
    try this code.
    data : string1(50) type c,
              flag(1) type c,
              dummy(50) type c,
              i type i,
              len type i.
    string1 = 'HI  READ    THIS'.
    len = strlen( string1 ).
    do len times.
    if string1+i(1) = ' '.
    flag = 'X'.
    else.
    if flag = 'X'.
    concatenate dummy string1+i(1) into dummy separated by space.
    clear flag.
    else.
    concatenate dummy string1+i(1) into dummy.
    endif.
    endif.
    i = i + 1.
    enddo.
    write : / string1.
    write : / dummy.

Maybe you are looking for

  • How to copy a file from one location to another ???

    Hi, I have a file ('D:/Pictures/1.jpg') and I want to copy this 1.jpg file to a location called 'D:/Folder1'. I tried the WebUtil_File.copy_file function, but it does not work. it returns false boolean. I am using windows xp and oracle 10g. The webut

  • Withholding Tax not picking for the current Fiscal year 2014

    Dear Gurus, Withholding tax assigned to the vendor is getting picked up for the fiscal year 2013 but when the same vendor is invoiced for year 2014 with the same WHT tax code we could see that there is no tax line getting generated against the Vendor

  • Dynamic field in Variant

    Hi, I have to make Period (from),Year (from),Period (to) and Year (to) as Dynamic in  the Variant for Program RKKRCO02.These are of type Parameters. Please let me know how I can get it done. Thanks in Advance, Savitha

  • Using SQL Developer and IPC connection

    SQL Dev 1.0.0.15 on Windows XP On the windows PC I am run SQL Dev on I have a Listener & tnsnames setup to use an IPC connection. I did not have the listener setup to use a protocol of TCP. The connection to the db worked fine via sql+. Also I have t

  • How to automatically printed Posted FI documents

    Any idea about how to automatically print SAP FI documents as soon as they are posted? Regards Prabin