Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 352 Bytes

string-to-param-case.md

File metadata and controls

15 lines (13 loc) · 352 Bytes
title description author tags
String To param-case
Converts a string into param-case
Mcbencrafter
string,conversion,param-case
public static String stringToParamCase(String text) {
    return text.toLowerCase().replaceAll("\\s+", "-");
}

// Usage:
System.out.println(stringToParamCase("Hello World 123")); // "hello-world-123"