Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 21:18:48 +0000



Post From: Parse a comma delimited string

[2024-02-06 20:11:00]
User719512 - Posts: 264
Post your code Ticks, maybe others will want your 8 lines over my example. I only posted something since you said you could not find an answer when searching this forum.

Mine is designed to be a function, reusable, and componentized and also handle test cases like:
""
"1"
"1,-1,2"
"1, 2, -3,4,5"
and will ignore alpha characters for a bad input like "1,2a,3"

No right or wrong solution depending on your needs and error checking requirements.