Answers for "trim the last 3 characters in bash"

3

bash remove last character from string

country="portugal"
modified=${country::-3}

echo $modified

Output:
	"portu"
Posted by: Guest on October-04-2021

Code answers related to "trim the last 3 characters in bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language