I have a function that receives a string of tags. In order to save the tags individually, the function transforms the string into an array:
this.tags = listToArray(this.tags, ", ");
How do I remove duplicate values in the event that there are any?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An easy way to remove duplicates from a list is to convert the list to a struct first, and then conver the struct to an array. However if the order of items in the list is important this may not be appropriate as the elements in the struct will be sorted.
If the order of items is important you would need to build the array manually rather than using the listToArray feature.