cleanup
This commit is contained in:
parent
fcb1f741b9
commit
ce95630cc6
4 changed files with 28 additions and 17 deletions
|
|
@ -14,4 +14,23 @@ public static class Helper
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static (int Row, int Col) ToRowCol(string letters)
|
||||
{
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
foreach (var item in letters)
|
||||
{
|
||||
if (item >= 'A')
|
||||
{
|
||||
row = row * 26 + (item - 'A' + 1);
|
||||
}
|
||||
else if (item >= '0')
|
||||
{
|
||||
col = col * 10 + (item - '0');
|
||||
}
|
||||
}
|
||||
|
||||
return (row, col);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue