Skip to content

Commit

Permalink
fix special character couting
Browse files Browse the repository at this point in the history
  • Loading branch information
smex committed Jul 14, 2022
1 parent 152011b commit aaa174f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion check_string.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash

# Place your code here
dig=${1//[^[:digit:]]/}
sp=${1//[^\!@#$%^&()_+]/}
ch=${1//[^[:alpha:]]/}

echo "Numbers: ${#dig} Symbols: ${#sp} Letters: ${#ch}"

0 comments on commit aaa174f

Please sign in to comment.