Revert "Don't split string just for counting "\n""

This reverts commit e50a29281e679a3906de0fc37d2b213b75d040ee.