Is it difficult to change a specific value in a list using set state?
Even if you search, you won’t find an easy function.
Given 1,2,3,4,5 and user wants to change 3 to 6
result
1,2,6,4,5
Is it difficult to change a specific value in a list using set state?
Even if you search, you won’t find an easy function.
Given 1,2,3,4,5 and user wants to change 3 to 6
result
1,2,6,4,5
Each item: find and replace
if it is a list of string then its difficult and use java script for that.
Unfortunately, the numbers are not unique.
When I did find&replace, my list became 6,6,6,6,6.
It’s such a simple function, but I can’t believe I have to use JavaScript.
Why don’t you reset the entire state on each change?
Eg: You have list of strings in a list of state 1,2,3,4,5,6. You would have used :plusitem when adding these numbers to the list. When you wish to update this state with different numbers, empty the existing state and replace it with the new one.
bubble has a proble dealing with list of string
consider i have a list lets say 1,2,3,4,5,36 of a string type. now u want to find 3 and replace it with 6 find and replace will do like following
1,2,6,4,5,66
This topic was automatically closed after 70 days. New replies are no longer allowed.