Created
August 3, 2022 01:06
-
-
Save webgtx/90c4976222997f48f54e824bf95db063 to your computer and use it in GitHub Desktop.
Slice string in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void slice(const char *str, char *result, size_t start, size_t end) | |
| { | |
| strncpy(result, str + start, end - start); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment