Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7415 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Does anyone have a calculation that will conver double barrel surnames to proper case - for example Smith-Davis (not Smith-davis) also O'Neill not O'neill.....there maybe others but has anyone got a solution that handles all these?

Thanks

Posted

If(Left(LeftWords(Text,1),2)="O'",

"O'" & If(PatternCount(LeftWords(Text,1),"-") =1,

Proper(Middle(Text,3,Position(Text,"-",1,1)-2)) &

Proper(Right(LeftWords(Text,1),Length(LeftWords(Text,1)) -

Position(Text, "-",1,1))),

Proper(Middle(Text,3,Length(LeftWords(Text,1))-2))),

If(Left(LeftWords(Text,1),2)="D'","D'" &

If(PatternCount(LeftWords(Text,1),"-") >=1,

Proper(Middle(Text,3,Position(Text,"-",1,1)-2)) &

Proper(Right(LeftWords(Text,1),Length(LeftWords(Text,1)) -

Position(Text, "-",1,1))),

Proper(Middle(Text,3,Length(LeftWords(Text,1))-2))),

If(Left(LeftWords(Text,1),2)="Mc","Mc" &

If(PatternCount(LeftWords(Text,1),"-") =1,

Proper(Middle(Text,3,Position(Text,"-",1,1)-2)) &

Proper(Right(LeftWords(Text,1),Length(LeftWords(Text,1)) -

Position(Text, "-",1,1))),

Proper(Middle(Text,3,Length(LeftWords(Text,1))-2))),

If(PatternCount(LeftWords(Text,1),"-") =1,

Proper(Left(Text,Position(Text,"-",1,1))) &

Proper(Right(LeftWords(Text,1),Length(LeftWords(Text,1)) -

Position(Text, "-",1,1))),

Proper(LeftWords(Text,1))))))

HTH

Lee

cool.gif

Posted

Try:

If (PatternCount (Test_Name;"-") = 0 ; Test_Name ;

( Let ( [ pos = Position(Test_Name ; "-" ; 1 ; 1) + 1; letter = Middle(Test_Name;pos;1)] ; Replace (Test_Name; pos;1;TextStyleAdd(letter;Uppercase)))))

Probably Queue could come up with something simpler, but at least the above works.

Posted

Here is another method:

If (PatternCount(Test_Name ; "-" ) = 0 ; Test_Name ;

Let ( [ pos = Position(Test_Name ; "-" ; 1 ; 1 ) + 1 ; letter = Middle (Test_Name; pos;1)] ;

Replace (Test_Name ; pos ; 1 ; Upper(letter))))

Versions before 7 don't have the Let function, so in that situation just substitute the full strings for pos and letter.

This topic is 7415 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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