You need to use the RichText
property of the cell. First copy the the shortened text from the cell, then clear the cell and insert the remaining parts of RichText
:
int firstDot = ws.Cell(1, 1).GetString().IndexOf(".");
IXLFormattedText<IXLRichText> strWithoutBold = ws.Cell(1, 1).RichText.Substring(firstDot);
ws.Cell(1, 1).RichText.ClearText();
foreach (IXLRichString rt in strWithoutBold)
{
ws.Cell(1, 1).RichText.AddText(rt.Text).CopyFont(rt);
}
PS1: when you use the index of the dot, you keep the dot (which is bold). You may need to +1
the index.
PS2: Similar to your previous question, this will only work with ClosedXML versions up to 0.92. Maybe I will have a look at the library and try to make a simpler solution possibly.