我想大写句子中的第一个字母和句号。谁能建议怎么做?
例如,
//I have the following in a language class.
"%s needs to identify areas of strength and
weakness. %s sets goals for self-improvement.";
// in a view
$contone=$this->lang->line($colstr);// e.g get the above string.
//$conttwo=substr($contone, 3);//skip "%s " but this doesnot work when there
//are more than one %s
$conttwo=str_replace("%s ", "", $contone);// replace %s to none
$contthree = ucfirst($conttwo); // this only uppercase the first one
我想要以下输出。
Needs to identify areas of strength and
weakness. Sets goals for self-improvement.