>ArkM's method is sufficient, but i prefer this way.
Keep in mind that of the potential ways to do this, strcspn is among the least efficient while strchr is among the most efficient.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004