Not able to write string[value]

The editor has a problem. I can’t write sting[some value here]. After putting square brackets, the variable string disappears.
Expected Result : string[value];
Actual Result : [value];