splitting a word
Go to solution
Solved by Eigenvektor,
Here's an example for a single string passed into the script
STRING=$1 STR_LENGTH=${#STRING} STR_MIDDLE=$((STR_LENGTH / 2)) STR_REMAINDER=$((STR_LENGTH - STR_MIDDLE)) echo $STR_LENGTH - $STR_MIDDLE - $STR_REMAINDER echo ${STRING:0:$STR_MIDDLE} echo ${STRING:$STR_MIDDLE:$STR_REMAINDER}
-
Featured Topics
-
Topics
-
0
-
2
-
DaveNoir ·
Posted in Troubleshooting0 -
PietervdWiel ·
Posted in New Builds and Planning0 -
1
-
4
-
floris.rodedio ·
Posted in CPUs, Motherboards, and Memory1 -
Tamgam12 ·
Posted in New Builds and Planning4 -
LeGreatMaxiking ·
Posted in New Builds and Planning6 -
ShotTequil ·
Posted in Audio0
-
-
play_circle_filled
Latest From ShortCircuit:
I tried 20 influencer foods, here are the best… and the worst…
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now