+ 3
Substring in C?
Is there any function in C language to print substring like in java there is substring(index1, index2)?? If yes then please show me example of code using substring
3 Answers
+ 3
There is no built-in substring function in string header. You can make your own version by using `strncpy`. But mind you if negative index is allowed, careful calculation is needed to copy the desired characters from and to the correct index.
+ 3
Try the strstr and there lot more you can check out the documentation
+ 2
Remember that you can make your own methods. Try to sort it out. Check C method tutorials for char arrays in Google.