3

How do I find and replace a single word of a string?

e.g. Calle Iparraguirre to Iparraguirre

I've tried:

replace( 'Calle\\s', 'Calle\\s', '')

replace( "name",'calle','')

and all combinations of code, but nothing is working :/

*I've read other Q&A's but no result

3

As stated in the function help, the correct syntax is

replace('QGIS SHOULD ROCK','SHOULD','DOES') → 'QGIS DOES ROCK'

Note that the function is case senstive so Calle != calle

  • 2
    I think i've put in the right syntax, but it removes all "name" strings (i checked Update existing fields: name) replace( 'Calle ' , 'Calle ' , '') – SanderH Aug 5 '14 at 19:39
  • 1
    Well, you are replacing 'Calle ' in 'Calle ' with an empty string ... therefore the result is empty ... Use replace(name, 'Calle ', '') instead. – underdark Aug 6 '14 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.