Skip to main content
Participant
April 20, 2006
Answered

REReplace

  • April 20, 2006
  • 3 replies
  • 466 views
Hello -

I am trying to remove a period from the end of a string and cannot seem to get it right. Here's an example of what I am trying to do.

Smith, John T. changed to Smith, John T

Also, some names do not have the "." at the end. For example: Smith, John Todd

I only need it to remove it if it is the last character in the string. I've come close with this:

#REReplace("#empinfo.Emp_Name#", ".$", "")#

It removes the last character regardless what it is. Any help is greatly appreciated.

Thanks.
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer expertnot
Thanks to both of you for your input. I tried the "\" first since I already had the code. It worked well.

Thanks again.

3 replies

Inspiring
April 20, 2006
A fullstop is a special character in regexes, meaning "any character"
(hence what you're seeing). So you need to escape it by preceding it with
a backslash:

\.$

--
Adam
expertnotAuthorCorrect answer
Participant
April 21, 2006
Thanks to both of you for your input. I tried the "\" first since I already had the code. It worked well.

Thanks again.
Inspiring
April 20, 2006
No text available