Fixed indexoutofbounds bug in StringExtension.cs.