How can I search and replace array[j]
by array
in the whole script?
I tried :%s/array[j]/array/
but that does not work.
Thanks!
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityYou need to escape the brackets, as they are special characters used to indicate a list in a substitution.
Your command should be :%s/array\[j\]/array/g