c# get string of given length for a given string code example Example: c# how to get length of string list list.Length // list represents the name of your list