You need to sign in to do that
Don't have an account?

Split the comma separated values and check length of each value
Hi All,
I have a requirement where the field holds comma separated values. Let's say 1234,4567,7890 like this. I want to split these values and check each value length. If length is <4 then error message should be displayed to user. Please help me how to achive this. I know that i should use split method first but after that how to check each field length?
Your inputs appreciated.
Thanks.
I have a requirement where the field holds comma separated values. Let's say 1234,4567,7890 like this. I want to split these values and check each value length. If length is <4 then error message should be displayed to user. Please help me how to achive this. I know that i should use split method first but after that how to check each field length?
Your inputs appreciated.
Thanks.
You can use the method as follows
All Answers
I hope this help
Please correct the single quote. I guess since I did that solution from my phone it put the wrong one. Anyways you sill automatcially see that in the code editor.
Please do provide your feedback.
Thanks for your prompt reply. let me try this nad get back.
Thanks.
Yes this helps alot. But i need to get the field value dynamically instead of directly passing to a string variable.
Thanks.
Could someone pleasehelp me further on this. I need to display error message if user enters field value as 1234,5678,912 and trying to save record. Logic should check each value before comma and check legth of it. I need this to be executed in before insert and update.
Thanks.
You can use the method as follows
Thank you so much. It helps me alot.
Thanks.