How to find substring from string without using indexof method in C#?

前端 未结 7 1441
时光取名叫无心
时光取名叫无心 2020-12-20 05:44

I want to find the position of a substring in a string if present without using any string method including indexof. I tried so much times but failed. Will anybody tell me h

7条回答
  •  醉酒成梦
    2020-12-20 06:04

    Assuming this is homework, my suggestion is to bear in mind that a string is an IEnumerable of chars. So you can loop through the characters in your string...

提交回复
热议问题