lyoutakoduka / spartaproject

MIT License
0 stars 0 forks source link

Create module to standardize string to string used for key of dictionary #39

Closed lyoutakoduka closed 5 months ago

lyoutakoduka commented 5 months ago

Module have following 3 public methods which standardize string to key of dictionary. It used for management of email address or username.

1: Convert upper case string to lower case. "Test" -> "test"

2: Convert following characters to under bar. " ": "test name" -> "test_name" ".": "test.name" -> "test_name"

3: Remove under bar of the both ends recursively. "__test__" -> "_test_" -> "test"

lyoutakoduka commented 5 months ago

Add hyphen to replacing characters.

2: Convert following characters to under bar. "-": "test-name" -> "test_name"