I’m facing a problem to solve this issue. I’m having a string variable, for an example
string text="ABCD,ABCDABCD,ADCDS";
I need to search a string value like ‘BC’ into above string and find the position where “BC” occur. i.e if we search “BC” in to that string variable it will bring the output as 1,6
0 1 2 3 4 5 6 7 8 9 10 11 12 13
-------------------------------------------------------
| A | B | C | D | , | A | B | C | D | , | A | D | C | S |
-------------------------------------------------------
The problem is we cant use built in string class methods contains(), lastIndexOf(). can anyone help me to do this?
Then you can built your own. I assume that even
Substringis forbidden.Here’s the running code: http://ideone.com/s7ej3