Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

itqpleyva/SpringBootMultiLineString

Repository files navigation

SpringBootMultiLineString

Spring Boot MultiLine string example

@SpringBootApplication
public class Main implements CommandLineRunner {
 public static void main(String[] args) {
 SpringApplication.run(Main.class, args);
 System.out.println("I am in");
 }
 public void run(String... args) throws Exception {
 //Creating string reporte
 
 String reporte = "";
 for (int i = 0; i < 10; i++) {
 reporte = reporte +"Line"+i+ "\n";// Line1\nLine2\n.......
 }
 //Creating file.txt saving the string and defining as multiline
 
 FileWriter fileWriter = new FileWriter("file.txt", true);
 BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
 bufferedWriter.write(reporte + "\n");
 bufferedWriter.flush();
 bufferedWriter.close();
 fileWriter.close();
 }
}

About

Spring Boot MultiLine string example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /