For example
var=" |"
and
var2="hello"
How do I delete number of space characters that equals to the length of var2?
So var will now be " |" instead of " |"
I thought of doing something with ${#var2} minus var but I don't know how to delete specific characters.