class Demo {
static String html() {
return """
<html>
<body>
<h1>Hello</h1>
</body>
</html>
""";
// The common indentation (12 spaces here) is stripped automatically.
}
static String sqlQuery(int userId) {
return """
SELECT u.id, u.name, COUNT(o.id) AS order_count
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE u.id = %d
GROUP BY u.id, u.name
""".formatted(userId);
}
static String json(String name) {
return """
{
"name": "%s",
"created_at": "2025-03-12T14:00:00Z"
}
""".formatted(name);
}
}
Create a free account and build your private vault. Share publicly whenever you want.