字符串去掉前后空格

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

name = " W3Cschool "

response.write("visit" & name & "now<br>")

response.write("visit" & trim(name) & "now<br>")

response.write("visit" & ltrim(name) & "now<br>")

response.write("visit" & rtrim(name) & "now")

%>

 

</body>

</html>

结果:

visit W3Cschool now
visitW3Cschoolnow
visitW3Cschool now
visit W3Cschoolnow

相关文章