-4

I want find a string array in other string array. How I do that?

Example:

string[] a = {"a","b","c","d","e","f","g","c","d","e"}

string[] b = {"d","e"}

How find b in a, I need get the index of all instances.

Heretic Monkey
  • 11,078
  • 7
  • 55
  • 112
  • what have you ***tried yourself*** so far? what problems did you encounter? what have you researched? i recommend [taking the tour](https://stackoverflow.com/tour), as well as reading [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and [what's on topic](https://stackoverflow.com/help/on-topic). – Franz Gleichmann Jun 30 '21 at 18:30

1 Answers1

-2

I would suggest you search a bit of the documentation to understand more of the language but anyway I'll try to explain what you can do

You can do a for loop going through the a array and inside you do a for loop going through the b array, if a[index] = b[index2] you break out of the a loop and put the index in a new array that you initialized before

If you need more help than that say but I recommend going through more documentation and a few videos and learn a bit more the basics

Dharman
  • 26,923
  • 21
  • 73
  • 125
João Garrido
  • 44
  • 2
  • 7