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.

counting spaces

Featured Replies

  • Newbies

I have a situation where i need to count the number of leading spaces in a text field. Does anyone have thoughts on how to do this. Please keep in mind that spaces could be anywhere in the text, including trailing. I only wan to count the leading spaces.

Thanks

This seems to work, if your first character other than a space is an letter or digit. It considers punctuation (incl. #@-_., etc.) to be the same as a space however.

Let (

word1 = LeftWords ( Text_; 1 );

Position ( Text_ ; word1 ; 1 ; 1 ) - 1

)

Hi

you can try this calc too...

Length ( GetValue ( Substitute ( yourField ; Trim ( yourField ) ; ¶ ) ; 1 ) )

This counts the leading spaces whatever char is after them. ( and counts the spaces even if there aren't chars ! )

... and, to count the trailing spaces:

Length ( GetValue ( Substitute ( yourField ; Trim ( yourField ) ; ¶ ) ; 2 ) )

Very nice.

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.