webpro 31 Posted September 21, 2013 Report Share Posted September 21, 2013 I'm trying to remove a certain item from a list.In fact, it's list with profile urls only.The url i want to remove from the list ,could be anywhere. I tried this but it doesn't work set(#remove, $replace(%profileurls, "http://thestaff.site.com/", $nothing), "Global")or set(#remove, $replace regular expression(%profileurls, "http://thestaff.site.com/", $nothing), "Global") So how do you remove specific things on a list ?In this case:http://thestaff.site.com/ Thanks Quote Link to post Share on other sites
UBotDev 276 Posted September 21, 2013 Report Share Posted September 21, 2013 Here is the code you are looking for, it will remove selected item from a list: ui drop down("Remove From List:", "a,b,http://thestaff\\.site\\.com/,c,d", #REMOVE String) clear list(%LIST) clear list(%LIST Original) add list to list(%LIST Original, $list from text("a,b,http://thestaff.site.com/,c,d", ","), "Delete", "Global") add list to list(%LIST, $list from text($replace regular expression(%LIST Original, "(?<=\\n|^){#REMOVE String}(?=\\n|$)", $nothing), $new line), "Delete", "Global") However, I need to warn you that this code could behave unpredictable if original list contains items with new line character inside them. Because of that I suggest you use this approach instead:find list item position (manually by looping through list) remove list item with "remove from list" commandAlternatively you could also find list item position by moving original list to a table and use "$table search" function there., then you use that integer in "remove from list" command 1 Quote Link to post Share on other sites
webpro 31 Posted September 22, 2013 Author Report Share Posted September 22, 2013 I see, thanks for your help mate Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.