Answers for "bash remove last character from string"

1

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 "bash remove last character from string"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language