Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 vbscript 拆分字符串?
Dim personal_number Dim personal_prefix person_prefix = Split(personal_number, 4)
我想拆分 person_prefix 并获取前四个字符。这是正确的方法吗,因为它似乎在 document.write 上返回了整个字符串。
要返回前四个字符,请person_prefix = Left(personal_number, 4)改用。
person_prefix = Left(personal_number, 4)
(字符串拆分使用提供的分隔符将字符串分解为数组:与您的情况无关)。