atro problema.
in c# ho questo metodo:
codice:
private char CodFiscControl(string strVal)
{
int pesi = 0;
int[] arrPesi = {1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 1, 0, 5, 7, 9, 13, 15, 17, 19, 21,
2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23};
strVal = strVal.ToUpper();
for (int i = 0; i < strVal.Length; ++i)
{
if (((i + 1) % 2) == 0)
{
if (Convert.ToInt32(strVal[i]) >= Convert.ToInt32('0') && Convert.ToInt32(strVal[i]) <= Convert.ToInt32('9'))
.......
in java lo sto traducendo così:
codice:
private char CFControl(String stringVal) {
int pesi = 0;
int[] arrayPesi = {1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23};
stringVal = stringVal.toUpperCase();
for (int i = 0; i < stringVal.length(); ++i) {
if (((i + 1) % 2) == 0) {
if(Integer.parseInt(stringVal[i]) >= Integer.parseInt("0") && Integer.parseInt(stringVal[i]) <= Integer.parseInt("9"))
mi da però questo problema:
array required, but java.lang.String found
if(Integer.parseInt(stringVal[i]) >= Integer.parseInt("0") && Integer.parseInt(stringVal[i]) <= Integer.parseInt("9"))
come posso risolvere??