if yes can youshow how to put delimiters in strtok for this
Can we have used strtok instead?
hi @sagar_aggarwal strok will not work for this function because, let me explain with an example
if a string is hello,world and you put , as a delimiter, then in the output, , will not be there. it will be hello
world
so if we try to use capital letters as delimiters in this question, they will also not be present in the output
so for string HelloWorld the output will be
ello
orld
but we want the output as
Hello
World
I hope you have understood why using string tokenizer is not possible here.
Dont forget to mark your doubt as resolved!
ok i got it @Ishitagambhir but can you show how can we use capital letters as an identifier delimiter for I Am Competetive Coder
and expecteed output is
I
m
ompetetive
oder
@sagar_aggarwal you can use multiple delimiters in the argument for strtok, so just put “ABCD…Z” (all the characters you want as delimiters) in the argument.
“A B C D … Z” is their space b/w them?
@sagar_aggarwal no need for space, if you add space then space will also be considered as a delimiter