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.
我有类似的字符串962=962&961=961&485=485
962=962&961=961&485=485
我想将值保存到数组中。
我可能会问一个愚蠢的问题,但我被困在这里。
谢谢
如果您想要所有值,可以将正则表达式传递给split():
>>> "962=962&961=961&485=485".split(/[=&]/) ["962", "962", "961", "961", "485", "485"]