java replace dot with comma

Ads
 

java replace dot with comma

Hi,

How to replace dot with command in Java program?

thanks

View Answers

October 18, 2018 at 2:27 AM

Hi,

Here is simple example for replacing the dot(.) with comma:

package test.app;

public class JavaStringExample {

    public static void main(String[] args) {
        String str="Hello. How are you?";
        str = str.replaceAll("\\.", ",");
        System.out.println(str);

    }

}

Thanks

Ads









Related Tutorials/Questions & Answers:
find and replace in java
find and replace in java  Need 'find and replace' function in Java to find special keyword in XMl such as @,#,!,%..and replace with their corresponding entities
How to split string in Java using comma?
How to split string in Java using comma?  Hi, Share the example code for splitting the string in Java using comma as separator. Thanks   ...(","); You can check the thread How to split string in Java?. Thanks
Advertisements
Java replace all non alphanumeric
Java replace all non alphanumeric  Hi, In Java how to replace all non alphanumeric characters with blank? Share me the best code for java replace...() function of String class in Java. We will use the regular expression "[^a-zA-Z0-9
Inserting Comma in a decimal number - Java Beginners
Inserting Comma in a decimal number  Hi, I want to insert comma in a number that contains decimals also. How can I get 99,999.99 when I have 99999.99. Please tell me. I need it urgently. Thanks a Lot  Hi friend,import
Replace
Replace   Hi, I have two text files in two diff locatons.The text file like below using java program 1)a.txt 1 abc bangalore 2 def adfsdf 3 ghij asdfdsad 2)b.txt A B C Now i want output is like below
dot net
dot net  how to open a new window having detailed contents by clicking a marquee text in a page(like news details opening on clicking flash news title) in dot net 2003
Java arraylist to comma separated string
arrayList is converted into the comma separated string. For this take one by one element from the arrayList. Then add it to the String array. Example of Java Arraylist Comma Separated String import java.util.ArrayList
struct dot notation
struct dot notation  what is a dot notation in struct
SQL in dot net
SQL in dot net  write a code in dot net which connects to a database, retrieves the data and allows to input a valid phone number
About search and replace contains of .doc or .docx file using java.
About search and replace contains of .doc or .docx file using java.  Hi , I am trying to replace contents of ms.word document in .doc or .docx... any one tell me how could I replace them using java
Java String : Replace All
Java String : Replace All This section defines how to replace all character with specified character without using system methods. Replace All method : You can replace all specific character in a given string with another character
ereg_replace() and eregi_replace().
ereg_replace() and eregi_replace().  What is the difference between eregreplace() and eregireplace()?   Hi friends, ereg_replace() is case sensitive like "Bharat"cannot be treated as "bharat"and eregi_replace
Dot Net Architect
Dot Net Architect       Position Vacant: Dot Net Architect Job Description  Candidates will be handling Dot Net Projects.   
Replace TEXT
Replace TEXT   I have two text files in two diff locatons.The text file like below using java program 1)a.txt 1 abc bangalore 2 def adfsdf 3 ghij asdfdsad 2)b.txt A B C Now i want output is like below
remove comma from string php
remove comma from string php  How to remove the last comma from the string in PHP
PHP Comma vs Period - PHP
PHP Comma vs Period  Explain PHP Comma vs Period. And also how can one show a comma within a comma separated file.   Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpbasics/PHP
java script to replace words starting and ending with tild(~) symbol in a text area with the word highlighted yellow.
java script to replace words starting and ending with tild(~) symbol in a text... requirement we have to replace all the occurence of such words and replace... like ~anyword~ and replace it with anyword highlighted yellow. this is bit
remove comma from string php
remove comma from string php  How to remove the last comma from the string in PHP?   remove last comma from string names = names.replaceAll(",$", ""); //Or a simple substring: if (names.endsWith(",")) { names
Checking the decimal whether comma used or not
Checking the decimal whether comma used or not  I need to check the given integer whther comma used or not. For example. If the user given 123456... be like 123,456.5 The comma has to be filled from the right side after 3 digits
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between ereg_replace() and eregi_replace()?  What is the difference between eregreplace() and eregireplace
replace character in php
replace character in php  PHP script that replace character
php comma delimited string to array - PHP
php comma delimited string to array  how can we split comma delimited string in to an array
php comma delimited string to array - PHP
php comma delimited string to array  how can we split comma delimited string in to an array
MySql find and replace string
MySql find and replace string  How to find and replace string or special characters in MySql & PHP?   Find and Replace String PHP $result = preg_replace('/\band\b/i', 'foo', $subject
regexp_replace in update and replace query in postgres
regexp_replace in update and replace query in postgres  update message set data = replace (data, 'wmost','westernmost'); April 4, 2011 at 5:04 PM.... is there a way to avoid this problem. Can you send similar query using regexp_replace
MySQL Replace
MySQL Replace       MySQL Replace function finds and replaces the occurrences of specified string...: REPLACE( String_Text, String_FROM, String_TO); where String_Text
Difference between translate and replace
Difference between translate and replace   hiii, What is the difference between translate and replace?   hello, Replace replace every.... this work for entire word and pattern,. Translate replace the one charecte
Replace String in PHP - PHP
Replace String in PHP  What is the fastest way of replacing string in PHP Code?  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpbasics/PHP-Array-Replace.html Thanks
String doubt replace function
String doubt replace function  What is the output and why of below : String s1 = "Hello"; if(s1.replace('H','H')== "Hello") System.out.println("yes"); else System.out.println("No"); if(s1.replace("H", "H")== "Hello
like query and then update or replace
like query and then update or replace   In postgres i use like query to find the a specific word in a column for example in a column i have text... to replace or update "wmost" to "westernmost" in that text. is there a way to do
replace special characters in html
replace special characters in html  How can i replace the special characters in HTML?   Special Character in HTML HTML has a long list of special characters symbol that can be used anywhere throughout the HTML Code

Ads