Added some utility methods in the Sections.
This commit is contained in:
@@ -213,14 +213,14 @@ namespace MarketDataLib.Utility
|
||||
}
|
||||
}
|
||||
|
||||
public static List<int> LocateAllOccurrences(String strInput,String item)
|
||||
|
||||
public static List<int> LocateAllOccurrences(List<String> sections, String item)
|
||||
{
|
||||
List<int> itemIndices = new List<int>();
|
||||
|
||||
try
|
||||
{
|
||||
if(null==item||null==strInput)return null;
|
||||
List<String> sections=Sections.GetSections(strInput);
|
||||
if(null==item)return null;
|
||||
if(null==sections||0==sections.Count)return null;
|
||||
for(int startIndex=0;startIndex<sections.Count;startIndex++)
|
||||
{
|
||||
@@ -239,6 +239,19 @@ namespace MarketDataLib.Utility
|
||||
}
|
||||
}
|
||||
|
||||
public static List<int> LocateAllOccurrences(String strInput,String item)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<String> sections=Sections.GetSections(strInput);
|
||||
return LocateAllOccurrences(sections, item);
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String LocateItem(String strInput,String item,int maxDepth)
|
||||
{
|
||||
int startIndex=0;
|
||||
|
||||
Reference in New Issue
Block a user