AnsweredAssumed Answered

Removing trailing character in a string

Question asked by BryanL_88 on May 8, 2018
Latest reply on May 9, 2018 by BryanL_88

Hello All,


I would like to get some help on the following issue that I encountered in ArcGis 10.3


The objective is to look through the whole string and remove just the "." from the string


Object ID        Field 

1                     Apple.

2                     Orange.

3                     Egg

4                     Pear

5                     Watermelon


I've tried using the following code which resulted in the all the last characters being removed instead of just "." :

Trim( LEFT ([Field], LEN( [Field]) -1))


I've also tried the code below which prompted an error message "Type mismatch" for both iif and InStr :


Trim(Left([Field], iif((InStr([Field], ".") = LEN([Field])), InStr([Field], ".")-1, LEN([Field]))))


I am using the Field Calculator in ArcGis 10.3.


Thanks for any help in advance.