de.joshuagleitze:string-notation

Convert between different string notations commonly found in programming

License

License

MIT
GroupId

GroupId

de.joshuagleitze
ArtifactId

ArtifactId

string-notation
Last Version

Last Version

1.4.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

de.joshuagleitze:string-notation
Convert between different string notations commonly found in programming
Project URL

Project URL

https://github.com/jGleitz/string-notation
Source Code Management

Source Code Management

https://github.com/jGleitz/string-notation

Download string-notation

Dependencies

runtime (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.3.61

Project Modules

There are no modules declared in this project.

string-notation CI Status Maven Central

Convert between different string notations commonly found in programming. Useful, for example, to build identifiers when generating code. Also includes notations to build valid Java type or member names.

API Documentation

Notations

We support the following notations:

Usage

string-notation converts Strings from their notation into a Word, which is a notation-agnostic representation. Words can then be transformed into Strings in a notation again.

Kotlin

import de.joshuagleitze.stringnotation.LowerCamelCase
import de.joshuagleitze.stringnotation.ScreamingSnakeCase
import de.joshuagleitze.stringnotation.fromNotation

// myVariable -> MY_VARIABLE
"myVariable".fromNotation(LowerCamelCase).toNotation(ScreamingSnakeCase)
import de.joshuagleitze.stringnotation.JavaTypeName
import de.joshuagleitze.stringnotation.NormalWords
import de.joshuagleitze.stringnotation.fromNotation

// 1 Type Name 4 You! -> TypeName4You
"1 Type Name 4 You!".fromNotation(NormalWords).toNotation(JavaTypeName)

Java

import de.joshuagleitze.stringnotation.LowerCamelCase;
import de.joshuagleitze.stringnotation.UpperCamelCase;
import static de.joshuagleitze.stringnotation.StringToWord.fromNotation;

// myVariable -> MY_VARIABLE
fromNotation("myVariable", UpperCamelCase.INSTANCE).toNotation(LowerCamelCase.INSTANCE);
import de.joshuagleitze.stringnotation.JavaTypeName;
import de.joshuagleitze.stringnotation.NormalWords;
import static de.joshuagleitze.stringnotation.StringToWord.fromNotation;

// 1 Type Name 4 You! -> TypeName4You
fromNotation("1 Type Name 4 You!", NormalWords.INSTANCE).toNotation(JavaTypeName.INSTANCE);

Contributions welcome

All contributions (no matter if small) are always welcome.

Versions

Version
1.4.0
1.3.0
1.2.1
1.2.0
1.1.0
1.0.0