splitting a word
By
g0ated
in Programming
in Programming
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}
-
Topics
-
0
-
Doctah ·
Posted in Peripherals0 -
2
-
michaelb198 ·
Posted in Peripherals1 -
errorcode123_dindin1 ·
Posted in Graphics Cards2 -
Packhunter ·
Posted in Graphics Cards3 -
12
-
6
-
VirusDumb ·
Posted in Programming0 -
Jayraj ·
Posted in Power Supplies4
-
-
play_circle_filled
Latest From Linus Tech Tips:
Google’s Best Feature In Years - WAN Show June 5, 2026
-
play_circle_filled
Latest From ShortCircuit:
The coolest looking monitor. Period. - ASUS ROG display at Computex (Sponsored)

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