Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Underscore b/w consecutive capatalized words
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Gaurav Singh
Underscore b/w consecutive capatalized words
1 Answer(s)      3 years and 9 months ago
Posted in : Java Beginners


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


Advertisement
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, when view is loaded then this method run one time but ViewWillAppear run whenever
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
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
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
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
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
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
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
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
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
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
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
Java program - convert words into numbers?
Java program - convert words into numbers?   convert words into numbers?   had no answer sir
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
Breaking the String into Words
Breaking the String into Words     ... into words. The java.util.*; package provides you a simple method to breaking the string into separate words. This program takes a string from user and breaks
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... Tell Me This Program.  Here is an example that reverse the words
 

 

 

DMCA.com