Replace comma with tab

tsmith2471

Newbie
Joined
Oct 21, 2012
Messages
14
Reaction score
4
I need some help with my program. Write a function that takes a string of comma seperated values and returnd a string of tab seperated values.
Code:
           String str = new String("Hello, BHW, how, are, you, today?");
        
        str.replaceAll("," , " ");

This is not replacing the comma with a tab. Any suggestions?
 
Last edited:
Sorry it was written in Java, but I figured it out

Code:
String str1 = new String("Hey,bhw,how,are,you,today?');
String str2 = str1.replace(',' , ' ');

System.out.println(str2);
 
Back
Top