Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A1形式の文字列をApache POIのgetRow及びgetCellメソッドの引数に指定できる数値の組(Tuple)に変換するためのScalaのメソッド。
// See for details.
def toRowCell(c: String, r: Int): (Int,Int) = {
var ci: Int = 0
var power: Int = 1
c.toCharArray.reverse.foreach(cr => {
ci += (cr-'A'+1)*power
power *= 26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment