public class Checkstring {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer();
String name = "Name";
String namevalue = "xxx";
buffer.append("<string name = " +"\""+name+"\"" +">"+namevalue.trim()+"</string>");
System.out.println("here output is "+buffer.toString());
String s = "test" + "/" + "test2";
String sampledoublequote = "Luni";
System.out.println("test here "+sampledoublequote.replaceAll("^\"|\"$", ""));
String s1 = "\"" +"out"+ "\"";
System.out.println(s);
System.out.println("double quotes "+s1);
String testcolon = "namratha;namratha";
System.out.println("Test colon "+testcolon.replace(";", ""));
// String addQuotes(String in ) {
// return "\"" + in + "\"";
// }
}
}
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer();
String name = "Name";
String namevalue = "xxx";
buffer.append("<string name = " +"\""+name+"\"" +">"+namevalue.trim()+"</string>");
System.out.println("here output is "+buffer.toString());
String s = "test" + "/" + "test2";
String sampledoublequote = "Luni";
System.out.println("test here "+sampledoublequote.replaceAll("^\"|\"$", ""));
String s1 = "\"" +"out"+ "\"";
System.out.println(s);
System.out.println("double quotes "+s1);
String testcolon = "namratha;namratha";
System.out.println("Test colon "+testcolon.replace(";", ""));
// String addQuotes(String in ) {
// return "\"" + in + "\"";
// }
}
}
No comments:
Post a Comment