intrixius
intrixius

Reputation: 1136

How to capitalize only first letter of a sentence

I know of the m function Text.Proper which capitalizes all words in a sentence. However, I want to know how I can capitalize only the first word of a sentence?

Upvotes: 0

Views: 479

Answers (5)

Ilija Sveti
Ilija Sveti

Reputation: 1

= Table.AddColumn(#"Previous step", "Custom", each Text.Combine({Text.Start([Column1], 1), Text.Middle(Text.Lower([Column1]), 1)}), type text)

Upvotes: 0

Timo Riikonen
Timo Riikonen

Reputation: 1

If you do the change in table, then

= Table.TransformColumns(#"Previous step",{{"Column name", each Text.Upper(Text.At(_,0)) & Text.Range(_, 1, Text.Length(_) - 1), type text}})

Upvotes: 0

Alexis Olson
Alexis Olson

Reputation: 40224

There are a couple of decent answers already, but here's another option that demonstrates a couple more functions:

Text.Upper(Text.At([Text],0)) & Text.Range([Text], 1, Text.Length([Text]) - 1)

Upvotes: 1

Daniel Herce
Daniel Herce

Reputation: 51

Try this, Excel style ;-)

let
    Input = "text to capitalize",
    Output = Text.Upper(Text.Start(Input,1)) & Text.End(Input,Text.Length(Input)-1)
in
    Output

Upvotes: 2

horseyride
horseyride

Reputation: 21393

Something along the lines of the following. You didn't specify any details

= Table.AddColumn(Source, "Converted", each Text.Upper(Text.Middle([Column1],0,1))&Text.Middle([Column1],1,Text.Length([Column1])))

Upvotes: 2

Related Questions