Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to remove the carriage return at the end of text?

Featured Replies

I’ve been struggled with this simple problem and I am sure (or I hope) someone out there has a simple solution.

What I try to do is to remove the space and carriage in the last line of text. I know how to use substitute to remove carriage return, but I have a note field that carriage return is ok unless it is the last line of text. The note field need to convert to html format and the last carriage return (returns) is a pain to deal with.

Thank you for your help.

-JJ

There are a couple of methods. One of my favorites is the following:

LeftWords(MYTABLE::myfield; 999999999)

The only problem with this approach is any word separator (return, space, period, etc.) not surrounded by a word is removed. For example, let's say you have the following text in your field:

Mary had a little lamb.¶

Not only will the return be removed but so willl the period. However, this solution works great on return-separated lists (like primary keys) because it is easy to implement. If you aren't sure about the data, it is better to use the following formula:

Left(MYTABLE::myfield; Length(MYTABLE::myfield) - 1)

This willl remove the last character. However, it won't remove more than one character or a random number of undesirable characters which gives an advantage to the LeftWords approach.

So, choose the method that best meets your needs.

Try:

Trim ( Substitute ( text & "§" ;

[ "¶§” ; "" ] ;

[ "§” ; "" ]

) )

Just for preventative maintenance visit the post at the link below. Comment came up with a calculation to remove x number of trailing carriage returns from a field. If you are getting a single trailing carriage return now your users are bound to mistakenly add more later. I know my users do it all the time.

I would copy and paste the calculation for you in this thread but I can no longer copy any text on this forum.

http://fmforums.com/forum/showtopic.php?tid/168001/post/168343/hl/Remove+carriage+return+sbg2/#168343

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.