How to get number of lines from a string by setting limited width

How to get number of lines from a string by setting limited width