Quick and simple: –

var count = mrString.Count(x => x == '$')

 

 

Advertisements