Difference between substring and subsequence
Answers
Answered by
3
hii dear....
I hope this will help u
the only difference between those two methods is the return type. One returns a String and the other returns a Char Sequence.
This is what people are talking about when they say the substring() And Subsequence() methods are identical when you call them on a String .
I hope this will help u
the only difference between those two methods is the return type. One returns a String and the other returns a Char Sequence.
This is what people are talking about when they say the substring() And Subsequence() methods are identical when you call them on a String .
Answered by
3
Sub-string vs Sub-sequence
Sub-string:
- It is a sub-part of a string.
- It is a contiguous part of the string.
Sub-sequence:
- It is also a sub-part of the string but not necessarily sequential characters.
Example:
[1,2,3,4]
Sunstring: 1 , 2 , 3 , 4 , 12, 23, 34, 123, 234,1234
Subsequence: nil, 1 , 2 , 3 , 4 , 12 , 13 , 14, 23, 24, 123, 234, 132, 321....
Similar questions