As we discussed earlier, string is a sequence of characters terminated by null character ‘\0’.
In this tutorial, we will learn how to play with the characters in the string.
Let’s take a sample string.
String manipulation in C
We can access each character in the string using index value like array.
String index also starts with 0.
Nth character of the string can be accessed by using index N-1.
Because string index starts with 0 Not 1.
To access 1st character of word, we should use index 0.
To access 4th character of word, we should use index 3.