Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This version replaces multiple hyphens with a single hyphen
- echo "$STRING" | iconv -t ascii//TRANSLIT | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z
- # This version maintains the number of hyphens
- echo "$STRING" | iconv -t ascii//TRANSLIT | sed -E 's/[^a-zA-Z0-9-]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement