Separate words from a string and convert them into a single string using hyphens.
const hyphenex = require('hyphenex');
console.log(hyphenex.hyphenate('This is hyphenating stuff'));
console.log(hyphenex.deHyphenate('hyphenating-this-this'));
console.log(hyphenex.hyphenateDynamically("This is dehyphanted string which is phenomenal", "-"))
console.log(hyphenex.deHyphenateDynamically("hyphenated+this+this+that", "+"));
the results must be:
This-is-hyphenating-stuff
hyphenating this this
This-is-dehyphanted-string-which-is-phenomenal
hyphenated this this that
Welcome to the documentation of hyphenex! After having a glance at this, you will be able to hyphenate strings like a pro!
This method will hyphenate your string using normal hyphens.
Example:
hyphenex.hyphenate("This is a long string");
// The results must be 'This-is-a-long-string'
Using this method you can hyphenate rather separate your strings with a custom separator!
Example:
hyphenex.hyphenateDynamically('This string will be hyphenated dynamically', "_");
// The results must be 'This_string_will_be_hyphenated_dynamically'
This will allow you to dehyphenate any string with ease.
Example:
hyphenex.deHyphenate("dehyphenate-this-string");
// The result must be 'dehyphenate this string'
Remove custom separators from a string.
Example:
hyphenex.deHyphenateDynamically("This+string+will+be+dehyphenated+dynamically", "+")
// Expect result to be 'This string will be dehyphenated dynamically'