Skip to content

Instantly share code, notes, and snippets.

@Bauepete
Bauepete / FileWriter.java
Created Apr 12, 2019
Files.write usage.
View FileWriter.java
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 Apr 8, 2019
RegEx handling in Java and the most important RegEx Patterns
View RegEx.java
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");