Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all how to implement code when we have the string like "this is java \n this is android \n this is .net" here i have to display the above text one by one in string[] type like.
this is java
this is android
this is .net
so help me to solve the problem
Posted

1 solution

Java
String[] lines = "this is java \n this is android \n this is .net".split("\n");
for (int i = 0; i < lines.length; i++) {
    Toast.makeText(this, lines[i], Toast.LENGTH_SHORT).show();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900