Replace the space in the string aa with "+" aa = System.Text.RegularExpressions.Regex.Replace(aa, @"\s+", "+");