ASP용 Nl2Br Codes 2010. 10. 28. 19:27

php에 있는 nl2br 함수를 예전에 만들었는데 제대로 작동하지 않는거 같아 다시 작성했다.

Function Nl2Br(strText)
    strText = Replace(strText, VbNewLine, "<br/>")
    strText = Replace(strText, VbCrLf, "<br/>")
    strText = Replace(strText, VbCr, "<br/>")
    strText = Replace(strText, VbLf, "<br/">)
    Nl2Br = strText
End Function

VbCr, VdLf 는 chr(10), chr(13)으로 대체 가능한거 같다.
이렇게 하고서야 제대로 동작하기 시작.