public class Solution { public int TitleToNumber(string s) { int result=0; char[] sarr=s.ToCharArray(); for(int i=0;i<s.Length;i++){ result=result*26+(sarr[i]-‘A‘+1); } return result; } }
Excel Sheet Column Number
原文:http://www.cnblogs.com/danwang/p/5557399.html