Skip to content

Instantly share code, notes, and snippets.

@bauepete
bauepete / FileWriter.java
Created April 12, 2019 15:16
Files.write usage.
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
public class FileWriter {
public static void main(String[] args) throws IOException {
System.out.println("File Write Collection");
String[] fileContent = {
@bauepete
bauepete / RegEx.java
Created April 8, 2019 12:15
RegEx handling in Java and the most important RegEx Patterns
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
System.out.println("RegEx Demo");
// The general java approach: Pattern, Matcher
Pattern p = Pattern.compile("b(a|e)uer");
Matcher m = p.matcher("bauer beuer");