1

I am trying to figure out how to remove the last value from a string in a legend while using data driven pages. I have a series of maps using dd pages and a reference grid, and each map has a key for the USGS Topo Quads that the map is showing. I need to be able to remove the last value ";" in each map. This is changing in most maps as different locations show different Topo maps. Im sure this is possible using python but i am not aware of how to employ this to allow only the last ";" to be removed in the dynamic environment. Thanks.

enter image description here

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
WasatchGIS
  • 19
  • 1
  • All your strings end in a `;` that you want to be removed is that correct? – FlyingTeller Sep 19 '18 at 16:02
  • 1
    Also, please include text as text and not as an image in your question – FlyingTeller Sep 19 '18 at 16:03
  • 1
    `string[:-1]` ? – mad_ Sep 19 '18 at 16:15
  • Possible duplicate of [Remove final character from string (Python)](https://stackoverflow.com/questions/15478127/remove-final-character-from-string-python) – Ruzihm Sep 19 '18 at 16:17
  • yes, my issue is that the last listed string changes with each map. So on one map a particular string will need the ";', while on another map it will not need the ";" – WasatchGIS Sep 19 '18 at 18:48
  • Still cannot figure this out. Anyone know how to use 'string [:-1]' in a legend to achieve my goal? As of now i am manually deleting and entering the ';' at the end of each legend name in the TOC for each map, as the last map listed on each data driven page is different based on location in the grid index. – WasatchGIS Dec 07 '18 at 17:42

0 Answers0