AddPunctuation

CString AddPunctuation(LPCTSTR text, UINT term, LPCTSTR punct)
{
	CString ret;
	ret.Format("%s", text);
	int end = (ret.GetLength() - 1) / term;
	for (int k = 0; k < end; k++)
	{
		ret.Insert(ret.GetLength() - (k + 1) * term - k * strlen(punct), punct);
	}
	return ret;
}

Leave a Reply

Your email address will not be published. Required fields are marked *