Re-designed the Site action so that you can now select a site, get a site name, or get a site name.
This commit is contained in:
@@ -11,5 +11,23 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
return double.Parse(str);
|
||||
}
|
||||
|
||||
public static int Position(this string str, char find, int instance)
|
||||
{
|
||||
var currentInstance = 0;
|
||||
for (var i = 0; i < str.Length; i++)
|
||||
{
|
||||
if (str[i] == find)
|
||||
{
|
||||
currentInstance++;
|
||||
if (currentInstance == instance)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user