如何使用javascript从字符串中获取值?

问题描述:

嗨专家,

我在java脚本中有一个字符串,如

Hi Experts,
I have a string in java script like

var str="ID:1:A;ID:2:B;ID:3:A;ID:4:c;ID:5:D"





现在我只知道 ID:2 我想让选项出现在 ID:2 前面,即:B



有没有人可以帮我用java脚本解决这个问题?



预付款

(Keerthi kumar)



Now i know only ID:2 i want to get the option present in front of ID:2 ie, :B

can any one please help me to solve this issue using java script?

thanks in Advance
(Keerthi kumar)

最适合你的地方是



https://blog.udemy.com/jquery-string-functions/ [ ^ ]
The best place for you is

https://blog.udemy.com/jquery-string-functions/[^]