Issues Using Title Case

So I am using Title Case to safely capitalize names but I have noticed that it will turn a capital letter in the middle of a name to lowercase. For example, in McNamara, the N turns to lowercase. Is there a way around this? Thanks

1 Like

Why don’t you use Assing then use String.toUpper() method?

@jpreziuso
This can’t be done with TitleCase, as far as I know. Title case will only preserve existing capital letters where the entire word is capitalized, this is to preserve acronyms.

What you can do is loop through your string and manually convert the first letter of each word to uppercase. To do this you’d use a For Each loop to loop through stringVar.Split(" "c). Then for each word you could do word(0) = word(0).ToUpper. (I think that works as-is but haven’t actually tested it.

I am testing it out. Thank you

1 Like

hi
usually TextInfo.ToTitleCase keeps the first character of the string (may be its first word or a second word in string) it will have the first character as UPPER Character….

To keep the in between upper case character as caps
–try enabling the simulate type,clickbeforetyping, and emptyfilelds
–the better the value be mentioned with .ToString at the end of it
like variablename.ToString
or
“yourstring”.ToString

this will maintain the character case of the string
if not as a lst chance we can enter as
variablename.ToString.ToUpper
or
“yourstring”.ToString.ToUpper

hope this would help you
Cheers @jpreziuso

yah TitleCase is not the answer because it will turn all to lower case and Capitalize the first letter.

Scenario 1.Loop to array of character.
2.Then pass the firstCharacter to a variable as upperCase
3.Then append all the remaining character in the updated firstcharter into variable.

Here are my sample activities kindly check Thanks :smiley:

Hope this make sense :smiley:

cheers :smiley:

Happy learning

Hi, thanks for the help. So in this scenario, the first variable you assign “McNamara” to is an array of characters?

Hi @jpreziuso

Heheeh are you referring to me . If yes yah what i did is to past the value “McNamara” to an array variable.

cheers :smiley:

happy learning :smiley:

1 Like

An array of what though? I tried characters from the selection menu but it is giving me an error

Nevermind, I understand now

1 Like

Hi @jpreziuso

thats great :smiley:

cheers :smiley:

Happy learning :smiley:

2 Likes