vb中的trim是什么意思

如题所述

'trim()是去除字符串头或尾部的空格,但不包含中间的空格。如:
Private Sub Form_Click()
dim str1 as string
dim str2 as string
str1 = " hello world "
str2 = trim(str1)
print str2
End Sub
'输出结果是"hello world"
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-16
删除字串符的空格。如
dim word as string=" abc"
trim(word)
word="abc"
第2个回答  2012-05-31
Trim()
  FUNCTION: 去掉字符串左右的空格.
  SYNTAX: Trim(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
  strTest = " This is a test!! "
  response.write Trim(strTest)
  %>
  RESULT: This is a test!!
第3个回答  推荐于2017-09-16
删除字串符的空格。如
dim word as string=" abc"
trim(word)
word="abc"
第4个回答  2012-05-31
Trim()
  FUNCTION: 去掉字符串左右的空格.
  SYNTAX: Trim(string)
  ARGUMENTS: string is any valid string expression.
  EXAMPLE: <%
  strTest = " This is a test!! "
  response.write Trim(strTest)
  %>
  RESULT: This is a test!!
相似回答
大家正在搜