calculating Width of the string

calculating Width of the string