how to remove characters from a string

Hi.

for the following line:

Var1=${Array[1]}

now Array[1] has text as "{hello there}"
how do I remove the {} brackets before assigning the string to Var1?

Thanks.

I tested array assignment and checking the values of the variables and arrays and did not have any issues with the brackets. Are you doing something differently then what is shown below, or are you adding different code or what?

#!/bin/bash

Arr[0]="Value 1"
Arr[1]="Value 2"
Arr[2]="Value 3"

echo '----- Array values 0 and 2 -----'
echo ${Arr[0]}
echo ${Arr[2]}

arrv1=${Arr[0]}
arrv2=${Arr[2]}

echo
echo '----- Variable values, containing the array values from 0 and 2 -----'
echo $arrv1
echo $arrv2

echo
echo '----- Finally, the array values printed out normally again, 0 and 2 -----'
echo ${Arr[0]}
echo ${Arr[2]}

They are always the same value and do not change, they never have the brackets in the values.

-bash-3.2$ ./test.sh
----- Array values 0 and 2 -----
Value 1[0]
Value 1[2]

----- Variable values, containing the array values from 0 and 2 -----
Value 1
Value 3

----- Finally, the array values printed out normally again, 0 and 2 -----
Value 1[0]
Value 1[2]
-bash-3.2$ vi test.sh
-bash-3.2$ ./test.sh
----- Array values 0 and 2 -----
Value 1
Value 3

----- Variable values, containing the array values from 0 and 2 -----
Value 1
Value 3

----- Finally, the array values printed out normally again, 0 and 2 -----
Value 1
Value 3

One way:

Var1=$(echo ${Array[1]} | tr -d '{}')

Yet another one:

var=${Array[1]:1:${#Array[1]}-2}