insert space into string with Field Calculator

811
2
Jump to solution
08-27-2021 01:18 PM
JasonFitzsimmons
Occasional Contributor
 

I am using ArcMap 10.7.1. This seems like it should be easy so maybe I am missing something.

I want to insert a space into a string between specific parts of the string using Field Calculator:

!FIELD! .replace("F'target", "F' target")

Neither 'F' or 'target' are at beginning or end of string, those characters are in the middle of a string.

I run the calculation, and nothing happens. I've tried to escape the single quote, but no difference. Do I need a wildcard tag at beginning and end of the substring?

I have tried this with VB and Python..I can change other string values in the same table.

0 Kudos
1 Solution

Accepted Solutions
JasonFitzsimmons
Occasional Contributor

I found the problem, the first single quote was " ‘ " instead of " ' "
Not sure how that got there but that was it

View solution in original post

0 Kudos
2 Replies
JayantaPoddar
MVP Esteemed Contributor

Could you share screenshot of the present values in the corresponding field of the attribute table? Do you have an apostrophe between F and target (e.g. F'target)?

 



Think Location
0 Kudos
JasonFitzsimmons
Occasional Contributor

I found the problem, the first single quote was " ‘ " instead of " ' "
Not sure how that got there but that was it

0 Kudos