Check if string contains space

后端 未结 3 1148
死守一世寂寞
死守一世寂寞 2020-12-31 17:28

I am trying to check if a sting has a space in it. The following is not working for me.

if (skpwords.contains(lcase(query)) And Mid(query, InStrRev(query, \"         


        
3条回答
  •  暖寄归人
    2020-12-31 18:01

    You could split the array using Ubound and check the length of the array to determine if there are spaces

    VBS Example:

    hi = "What is up"
    spaces = Ubound(Split(hi, " "))
    if (spaces = 0) then
        Wscript.Echo "No Spaces"
    else
        Wscript.Echo "There are spaces"
    end if
    

提交回复
热议问题