Skip to main content
Question

StringCaseChanger test for sting case first

  • September 23, 2021
  • 3 replies
  • 66 views

dos_gis
Contributor
Forum|alt.badge.img+3

Hi, I'm using StringCaseChanger but I'd first like to test if a attribute string is all caps. I'm using tester with Regex [A-Z\\s]+ and Case Sensitive mode but I'm not getting the expected results. Any ideas on how I can tester for attributes with all caps? These are paragraphs that might contain numbers and other symbols as well.

3 replies

Forum|alt.badge.img+2
  • September 23, 2021

@dos_gis​ Do you have a small example of a couple of strings that you're trying to test? If the string is already uppercase, then StringCaseChanger should just run it's course - assuming you're trying to make everything uppercase


dos_gis
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • September 23, 2021

Hi Mark, The data is a mix of uppercase and sentence case. I'd like to test for uppercase then use StringCaseChanger on that selection only - changing uppercase to title case.


david_r
Celebrity
  • September 24, 2021

The most robust way to do it is perhaps to create a copy of the original string and run it through the StringCaseChanger set to UPPER case. Then compare the original and the copy of the string; if identical, it was already all upper case.