Underscore b/w consecutive capatalized words

Underscore b/w consecutive capatalized words

I have a text something like this "25km from N of Rio Negro" I want to add underscore between consecutive Capatalized words having space between them. Can some one give me the solution to it.

regards YJS

View Answers

March 31, 2011 at 5:26 PM

class AppendUnderScoreToString 
{
    public static void main(String[] args) 
    {
        String st="25km from N of Rio Negro";
        String newstring=st.replaceAll("(.)([A-Z])", "$1_$2");
        System.out.println(newstring);

    }
}









Related Tutorials/Questions & Answers:
Underscore b/w consecutive capatalized words
Underscore b/w consecutive capatalized words  I have a text something like this "25km from N of Rio Negro" I want to add underscore between consecutive Capatalized words having space between them. Can some one give me
difference b/w == and equals()
difference b/w == and equals()  what is the difference between == operator and equals()   Hi Friend, The == operator checks if the two objects were actually the same object. This operator looks at the actually memory
Advertisements
Diff b\w C++ & Java
Diff b\w C++ & Java  What is the difference between C++ & Java
difference b/w viewdidload and ViewWillAppear
difference b/w viewdidload and ViewWillAppear   hello all, what is the difference b/w viewdidload and ViewWillAppear ???   hello,ADS_TO_REPLACE_1 when view is loaded then this method run one time but ViewWillAppear
diff b/w applet and servlet
diff b/w applet and servlet  what is the difference between applet and servlet?   Difference between servlet and applet: 1)An applet is client side programming whereas servlet is server side programming. 2)Applets run
Difference b/w spring 2.x and 3.x
Difference b/w spring 2.x and 3.x  difference b/w spring 2.x and 3.x
diff b/w struts 1.0 and 1.2
diff b/w struts 1.0 and 1.2  diff b/w struts 1.0 and 1.2
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect.... b) If you are using oracle thin driver,you have to use: Connection conn
what is difference b/w oracle 8i, 9i and 10g
what is difference b/w oracle 8i, 9i and 10g  what are the difference between oracle 8i,9i and 10g? I am not considering the versions and their supported os, in the interview point of view
rexexp pattern to avoid certain words and replace space with underscore
rexexp pattern to avoid certain words and replace space with underscore  I have a text string like "On River Thames in eastern London" and i want to replace space between two capital words with underscore so that "River Thames
how to establish connection b/w java app and mobile phone
how to establish connection b/w java app and mobile phone  hello, my name is Dhanraj. i'm doing a project in my college. In that project we need to send SMS from our phone to a java application situated on a remote server
Diff b/w servlet n jsp - Java Interview Questions
Diff b/w servlet n jsp  hii i want to know the difference between servlet and jsp. please give me the details to understand them in correct. thanks in advance  Nothing my friend. Both are same. Only thing
Difference b/w jdk 1.1 and 1.2 - Development process
Difference b/w jdk 1.1 and 1.2  Can you plz specify the changes/developments that have taken place from JDK 1.1 to JDK 1.2 and which version is the industry following currently.  Hi friend, Changes to CLASSPATH
underscore as character
underscore as character  how can i consider _ as a character instead of wildcard character? my problem is like this i have 20 records as follows manohar 1234455 manohar 453635 manohar 345454 manohar_1234455 now when i am
ModuleNotFoundError: No module named 'Underscore'
ModuleNotFoundError: No module named 'Underscore'  Hi, My Python... 'Underscore' How to remove the ModuleNotFoundError: No module named 'Underscore' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'django-underscore'
ModuleNotFoundError: No module named 'django-underscore'  Hi, My... named 'django-underscore' How to remove the ModuleNotFoundError: No module named 'django-underscore' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-underscore'
ModuleNotFoundError: No module named 'django-underscore'  Hi, My... named 'django-underscore' How to remove the ModuleNotFoundError: No module named 'django-underscore' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-underscore'
ModuleNotFoundError: No module named 'django-underscore'  Hi, My... named 'django-underscore' How to remove the ModuleNotFoundError: No module named 'django-underscore' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'XStatic-underscore'
ModuleNotFoundError: No module named 'XStatic-underscore'  Hi, My... named 'XStatic-underscore' How to remove the ModuleNotFoundError: No module named 'XStatic-underscore' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'djungle-underscore'
ModuleNotFoundError: No module named 'djungle-underscore'  Hi, My... named 'djungle-underscore' How to remove the ModuleNotFoundError: No module named 'djungle-underscore' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-babel-underscore'
ModuleNotFoundError: No module named 'django-babel-underscore'  Hi...: No module named 'django-babel-underscore' How to remove the ModuleNotFoundError: No module named 'django-babel-underscore' error? Thanks   
ModuleNotFoundError: No module named 'django-babel-underscore'
ModuleNotFoundError: No module named 'django-babel-underscore'  Hi...: No module named 'django-babel-underscore' How to remove the ModuleNotFoundError: No module named 'django-babel-underscore' error? Thanks   
Maven Repository/Dependency: org.webjars.bower | underscore
Maven Repository/Dependency of Group ID org.webjars.bower and Artifact ID underscore. Latest version of org.webjars.bower:underscore dependencies. # Version Release Date 1
Find consecutive numbers whose sum is equal to input number.
Find consecutive numbers whose sum is equal to input number. In this section, you will learn how to display the consecutive natural numbers whose sum is equal... possible combination of consecutive naturalnumbers which add up to give the N
Maven Repository/Dependency: org.webjars.npm | underscore
Maven Repository/Dependency of Group ID org.webjars.npm and Artifact ID underscore. Latest version of org.webjars.npm:underscore dependencies. # Version Release Date 1 1.13.6
ModuleNotFoundError: No module named 'words'
ModuleNotFoundError: No module named 'words'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'words' How to remove the ModuleNotFoundError: No module named 'words'
Technical words for Business Analyst
Technical words for Business Analyst  Please provide me the list of technical words that a business analyst can use while creating artifacts
reverse words in a string(words seperated byone or more spaces)
reverse words in a string(words seperated byone or more spaces)  reverse words in a string(words separated by one or more spaces
Searching English words in a string
Searching English words in a string  My task is to find English words and separate them from a string with concatenated words..for example AhdgdjHOWAREgshshYOUshdhfh I need to find if there exists any English words.   
Count words in a string method?
Count words in a string method?  How do you Count words in a string...(" "); System.out.println("Number of words : "+arr.length); }catch(IOException e... of words : 4 Description: This example counts the number of words into inputted
JavaScript split string into words.
JavaScript split string into words.  How to split string into words.... That is split str into words. Str.split("")-it split str into character. Str.split(" ",3)-split in word and return first 3 words
Java program - convert words into numbers?
Java program - convert words into numbers?   convert words into numbers?   had no answer sir
display co-occurrence words in a file
display co-occurrence words in a file  how to write java program for counting co occurred words in the file
display co-occurrence words in a file
display co-occurrence words in a file  how to write java program for counting co occurred words in the file
CONVERT VALUE MONEY TO WORDS IN SQL?
CONVERT VALUE MONEY TO WORDS IN SQL?  i want to covert money or varchar value (like 7500000 ) in words like (75 lacs) then how to convert this value in this words . please give me solution
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
ModuleNotFoundError: No module named 'amount-in-words'
ModuleNotFoundError: No module named 'amount-in-words'  Hi, My... named 'amount-in-words' How to remove the ModuleNotFoundError: No module named 'amount-in-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'amount-in-words'
ModuleNotFoundError: No module named 'amount-in-words'  Hi, My... named 'amount-in-words' How to remove the ModuleNotFoundError: No module named 'amount-in-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'english-words'
ModuleNotFoundError: No module named 'english-words'  Hi, My... 'english-words' How to remove the ModuleNotFoundError: No module named 'english-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'english-words'
ModuleNotFoundError: No module named 'english-words'  Hi, My... 'english-words' How to remove the ModuleNotFoundError: No module named 'english-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'number-to-words'
ModuleNotFoundError: No module named 'number-to-words'  Hi, My... named 'number-to-words' How to remove the ModuleNotFoundError: No module named 'number-to-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'send-words'
ModuleNotFoundError: No module named 'send-words'  Hi, My Python... 'send-words' How to remove the ModuleNotFoundError: No module named 'send-words' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'text-words'
ModuleNotFoundError: No module named 'text-words'  Hi, My Python... 'text-words' How to remove the ModuleNotFoundError: No module named 'text-words' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'text-words'
ModuleNotFoundError: No module named 'text-words'  Hi, My Python... 'text-words' How to remove the ModuleNotFoundError: No module named 'text-words' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'the-count-of-words'
ModuleNotFoundError: No module named 'the-count-of-words'  Hi, My... named 'the-count-of-words' How to remove the ModuleNotFoundError: No module named 'the-count-of-words' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'words-cli'
ModuleNotFoundError: No module named 'words-cli'  Hi, My Python... 'words-cli' How to remove the ModuleNotFoundError: No module named 'words... have to install padas library. You can install words-cli python with following

Ads