Titlecase formulas

edited March 2020 in FastReport .NET

Hello


i have a problem with "Titlecase" formulas


i used this formulas like this


[TitleCase([BarcodeTable.VariantItemExplanation1])]


But result is Upper case again


How can i used this formulas

Comments

  • TitleCase does not reduce letters, so as not to ruin the text (for example, abbreviations).

    You can wrap your text first in LoverCase and then use TitleCase. For example:

    [TitleCase(LowerCase([BarcodeTable.VariantItemExplanation1]))]

  • Hello

    Thank you :-)

  • Hello, how can I put only the first letter of a sentence in uppercase?

  • Hello!

    To solve your problem, you can capitalise only the very first letter of the sentence (Hello world abc): use the following C# expression:

    [Substring([Data.Text], 0, 1).ToUpper() + Substring([Data.Text], 1).ToLower()]

    (or with a check for an empty string: [string.IsNullOrEmpty([Data.Text]) ? ‘’ : char.ToUpper([Data.Text][0]) + [Data.Text].Substring(1).ToLower()]).

This discussion has been closed.