Validate List Item Length
Budget / SalaryHourly project
TypeFreelance project
LocationRemote
Posted2 hours ago
I have a dynamic list that occasionally comes through empty, and I want to be sure that, as items get added, every single entry respects one rule only: Specific length — each item must be less than 10 characters long. No other constraint (duplicates, numbers, etc.) matters for this task; I simply need reliable length-checking before an element is accepted.
Please deliver a small, clean utility or function (Python, JavaScript, or any language you prefer) that:
• Accepts raw user input or an existing array/list
• Verifies each prospective item is under 10 characters
• Blocks or flags anything that exceeds that limit, ideally returning a short reason so I can surface it in a UI later
Include concise inline comments, a brief read-me showing how to run or import the code, and one quick demo illustrating both valid and over-length inputs. If you rely on third-party libraries, list the exact versions used so I can replicate the environment easily.
Please deliver a small, clean utility or function (Python, JavaScript, or any language you prefer) that:
• Accepts raw user input or an existing array/list
• Verifies each prospective item is under 10 characters
• Blocks or flags anything that exceeds that limit, ideally returning a short reason so I can surface it in a UI later
Include concise inline comments, a brief read-me showing how to run or import the code, and one quick demo illustrating both valid and over-length inputs. If you rely on third-party libraries, list the exact versions used so I can replicate the environment easily.
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.