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

A space before each Capital Letter

Featured Replies

I am converting field names to values in a text field.  Field names are similar to:

FacilitySizeApproxImpervious

For the data, I want:  Facility Size Approx Impervioius

What is the best way to identify the capital letter and add a space before it (but obviously not the first capital letter)?  Thank you for any assistance.

By the way, I have this started:

Let ( 

field = table::FieldName
Substitute ( field ;

[ "A" ; " A" ] ;
[ "B" ; " B" ] ;
[ "C" ; " C" ]

But I wonder if there is a better way and that also replaces the first one.

I don't think there's a shorter way =

Trim ( 
Substitute ( text ;  
["A" ; " A" ] ; 
["B" ; " B" ] ; 
["C" ; " C" ] ; 
["D" ; " D" ] ; 
// ...
["X" ; " X" ] ; 
["Y" ; " Y" ] ; 
["Z" ; " Z" ] 
) 
)

Hopefully you don't have any accented or Greek capital letters.

 

 

Edited by comment

  • Author

Bingo!  Apply it and THEN removing the fist space!  Thank you so much!

  • Author
27 minutes ago, comment said:

Hopefully you don't have any accented or Greek capital letters.

Since they are field names, there shouldn't be; same with $# etc.  I anticipate the Users will have to review and correct some of them anyway but I want them to have a good start on the basic 'question labels.'  

49 minutes ago, comment said:

I don't think there's a shorter way

Well, that is unless you're willing to use a plugin:

BE_RegularExpression ( "AlphaBravoCharlie" ; "(\p{Lu})" ; "g" ; " $1"  )

will return:

" Alpha Bravo Charlie"

and will recognize any uppercase characters, in any language.

 

  • Author

WOW.  I hadn't created the calc yet and I am very willing to use Base Elements plugin since we use it all the time!  YOU ROCK!  :smile3:

That worked perfectly!

Even better =

BE_RegularExpression ( "AlphaBravoÇharlie" ; "(\p{Ll})(\p{Lu})" ; "g" ; "$1 $2”  )

returns:

"Alpha Bravo Çharlie"

Basically, this looks for a lowercase character (excluding punctuation and digits) followed by an uppercase one, and inserts a space between them.

 

 

Edited by comment

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.