Tighten up some exceptions in the log
Some checks failed
Build .NET Project / build (push) Has been cancelled
Some checks failed
Build .NET Project / build (push) Has been cancelled
This commit is contained in:
@@ -374,16 +374,20 @@ namespace MarketData.Utils
|
||||
|
||||
public static String KeepBefore(String strItem,String strKeepBefore)
|
||||
{
|
||||
if(null==strItem)return strItem;
|
||||
int startPos=strItem.IndexOf(strKeepBefore);
|
||||
if(-1==startPos)return null;
|
||||
return strItem.Substring(0,startPos);
|
||||
}
|
||||
|
||||
public static String KeepAfter(String strItem,String strKeepAfter)
|
||||
{
|
||||
if(null==strItem)return strItem;
|
||||
int startPos=strItem.IndexOf(strKeepAfter);
|
||||
if(-1==startPos)return null;
|
||||
return strItem.Substring(startPos+strKeepAfter.Length);
|
||||
}
|
||||
|
||||
public static String KeepAfterLast(String strItem,String strKeepAfter)
|
||||
{
|
||||
if(null==strItem)return null;
|
||||
@@ -391,6 +395,21 @@ namespace MarketData.Utils
|
||||
if(-1==startPos)return null;
|
||||
return strItem.Substring(startPos+strKeepAfter.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RemoveAfter - If remove after cannot find the target it simply returns the strign that was provided.
|
||||
/// </summary>
|
||||
/// <param name="strItem"></param>
|
||||
/// <param name="strRemoveAfter"></param>
|
||||
/// <returns></returns>
|
||||
public static String RemoveAfter(String strItem,String strRemoveAfter)
|
||||
{
|
||||
if(null==strItem)return strItem;
|
||||
int endPos=strItem.IndexOf(strRemoveAfter);
|
||||
if(-1==endPos)return strItem;
|
||||
return strItem.Substring(0,endPos + 1);
|
||||
}
|
||||
|
||||
public static String Find(String strItem,String search,char delimeter)
|
||||
{
|
||||
if(null==strItem)return null;
|
||||
@@ -412,6 +431,7 @@ namespace MarketData.Utils
|
||||
if(!foundDelimeter)return null;
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static String FindFirst(String strItem,String search,char delimeter)
|
||||
{
|
||||
if(null==strItem)return null;
|
||||
@@ -433,10 +453,12 @@ namespace MarketData.Utils
|
||||
if(!foundDelimeter)return null;
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static String AddQuotes(String item)
|
||||
{
|
||||
return "\"" + item + "\"";
|
||||
}
|
||||
|
||||
public static long DateToLong(DateTime date)
|
||||
{
|
||||
int year = date.Year;
|
||||
@@ -444,6 +466,7 @@ namespace MarketData.Utils
|
||||
int day = date.Day;
|
||||
return (year * 10000) + (month * 100) + day;
|
||||
}
|
||||
|
||||
public static DateTime LongToDate(long longDate)
|
||||
{
|
||||
int year = (int)(longDate / 10000);
|
||||
@@ -451,6 +474,7 @@ namespace MarketData.Utils
|
||||
int day = (int)(longDate - ((int)(longDate / 100)) * 100);
|
||||
return new DateTime(year, month, day);
|
||||
}
|
||||
|
||||
public static String DayOfWeekToString(DayOfWeek dayOfWeek)
|
||||
{
|
||||
switch(dayOfWeek)
|
||||
|
||||
Reference in New Issue
Block a user