digital-garden/archive/Я.Практикум/Полезное/Разделитель строк.md
2024-06-13 21:01:37 +03:00

13 lines
335 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Разделитель строк
```java
final String separator = System.getProperty("line.separator");
```
```java
final String separator = System.lineSeparator();
```
На windows 11 `System.lineSeparator()` может не разбивать файл на строки, нужно использовать `.split("\n");`
---