Jump 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.

Removing leading spaces in a Calculation field

Featured Replies

Hi everyone

I have a Calculation Field called "extract_field_1"
which extracts the data of "field_1" (ie, anything between "field_1:" and "field_2:"
in a text-field called INPUT
which looks like this:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Let ( [
lineStart = Position ( INPUT ; "¶field_1:" ; 1 ; 1 ) ;
start = lineStart + Length("¶field_1:");
end = Position ( INPUT ; "¶field_2:" ; start ; 1 )
] ;
Middle ( INPUT ; start ; end - start )
)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This works nicely (many thanks to comment for this).

However, sometimes the result will start with one or more "space" characters and sometimes not. It depends on what my user has typed into INPUT!!!

Can anyone recommend how to add to this Calculation so that:
-- any leading "spaces" are removed from the beginning of the result.

Thanks in anticipation.       Philip

Consider using the Trim() function that strips all leading and trailing spaces.

--
P.S. Please use the default font when posting.

  • Author

Thanks comment.

Of course Trim() worked perfectly.

Sorry about the large font size of my original message. I had to increase it so my poor elderly eyes could read my code on screen, and then I forgot to change it back down again afterwards.

Sorry, and Thanks. 

Stay Safe!

Create an account or sign in to comment

Important Information

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

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.