So I'm trying to use the YouTube API to extract some info about each video in a playlist, I've already used to API to get hold of the whole information and I've split it per line , just need to know how to find the number of each line which starts with "videoId" so that I can go from there.
You can use StartsWith()
which return true if the string starts with the value given
List<int> arrayIndex = new List<int>();
for(int i = 0; i < lines.Length; i++)
{
if (lines[i].StartsWith("videoId"))
{
arrayIndex.Add(i);
}
}
arrayIndex
will have the index of each line that started with "videoId"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments