如何替换换行符?

时间:2015-05-16 06:25:37

标签: vb.net visual-studio-2013

我尝试从字符串中删除多个换行符,但字符串仍保留在其中。这是我的代码:

str = str.Replace(ControlChars.Lf, ControlChars.NewLine)
str = str.Replace(ControlChars.Cr, ControlChars.NewLine)
str = str.Replace(ControlChars.CrLf, ControlChars.NewLine)
str = str.Replace(ControlChars.NewLine & ControlChars.NewLine & ControlChars.NewLine, ControlChars.NewLine)
str = str.Replace(ControlChars.NewLine & ControlChars.NewLine, ControlChars.NewLine)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

这应该有效:

SELECT routeid FROM t GROUP BY routeid
HAVING SUM(bustopid=9)>0
AND SUM(bustopid=11)>0