Breaking News
Loading...

Print special symbols like " , / , \ . ..

3:24 PM
Hi Every ody ,

I some case we have to print some special symbols like ' , " , / , like

that case simply add (forward slash ) \ before printing special symbol

Example :
-----------
here i want to print below message :

Hello " tutorials-Android " by sravan

then use
String str="Hello \" tutorials-Android \" by sravan";

Program :
-----------


public class Demo {
public static void main(String[] args) {
//String str="Hello\"hai\" wat dng";
String str="Hello \" tutorials-Android \" by sravan";
System.out.println(str);

}

}


out Put :
--------

Hello " tutorials-Android " by sravan

0 komentar:

Post a Comment

 
Toggle Footer