[Tex/LaTex] How to get sentence case in section titles without biblatex

sectioningtitlesec

I would like to change my section titles into sentence case just like the solution here:
How to make sections into sentence case

The titlesec package is already included in my document to modify section title formatting, so this seems like a good solution. The problem is that I am using a book class and require the chapterbib package. When I include the biblatex package to use the \MakeSentenceCase macro, it tells me that it's incompatible with chapterbib and fails to compile.

Is there an alternative method I can use to access \MakeSentenceCase or create a similar macro for use in the \titleformat command?

Best Answer

Using stringstrings:

\documentclass{article}
\usepackage{stringstrings}
\usepackage[explicit]{titlesec}

\newcommand\SentenceCase[1]{%
  \caselower[e]{#1}%
  \capitalize[q]{\thestring}%
}
\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection}{1em}{\SentenceCase{#1}\thestring}

\begin{document}

\section{test section one}
\section{TesT SectION Two}

\end{document}

enter image description here