I have a Column Title, and need to get its length but not counting any spaces.

This is a test should give me the length of 11

With LEN I can get the length of a string, but with the spaces. After searching a little bit I had the idea to replace all spaces with blank. But there is no Replace Function I could use.

The Replace Function that is build in can't be used that way, because I can only replace a specified character (via index) with another.

But I want to go over the Title and replace every occurring space with blank.

How is this possible?

  • Did you think to add a Script Editor and check it by javascript? (before save method) Can this idea fix to you? – Nk SP Nov 12 '14 at 9:40
  • No JS in this case :( – Loki Nov 12 '14 at 9:42
  • You should take a look of this: spregex.codeplex.com So you can add a regex validation column. Then use this regex to check the number of characters: ( *?[0-9a-zA-Z] *?){5,5} – Nk SP Nov 12 '14 at 10:10
  • Does it work with 2013 as well? – Loki Nov 12 '14 at 10:12
  • Guess so. Take a look also at this: 3sharp.com/blog/using-regular-expressions-in-sharepoint-lists – Nk SP Nov 12 '14 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.