大小寫轉換

2021-04-18 02:28:19 字數 2078 閱讀 2077

/// /// 小寫數值轉大寫  xieshuxu

///

/// 傳入轉換字串

/// 傳入整數單位 如:元

/// 傳入小數點後一位單位 如:角

/// 傳入小數點後兩位單位 如:分

///

public string xiaotoda(string xiao,string one,string two,string tree)

if (xiao.indexof(".") != -1)

//da = da.replace("零拾", "").replace("零佰", "").replace("零仟", "").replace("零萬", "").replace("零億", "");

int n = da.length;

for (int i = 0; i < n; i++)

else if (da[i].tostring() == "佰" && da[i - 1].tostring() == "0")

else if (da[i].tostring() == "仟" && da[i - 1].tostring() == "0")

else if (da[i].tostring() == "萬" && da[i - 1].tostring() == "0" && da[i - 2].tostring() != "拾" && da[i - 2].tostring() != "佰" && da[i - 2].tostring() != "仟")

else if (da[i].tostring() == "億" && da[i - 1].tostring() == "0" && da[i - 2].tostring() != "拾" && da[i - 2].tostring() != "佰" && da[i - 2].tostring() != "仟" && da[i - 2].tostring() != "萬")

}string xiaoshu = xia[1].replace("1", "壹").replace("2", "貳").replace("3", "叄").replace("4", "肆").replace("5", "伍").replace("6", "陸").replace("7", "柒").replace("8", "捌").replace("9", "玖").replace("0", "零");

da += one;

for (int i = 0; i < xiaoshu.length; i++)

else if (i == 1)

else }

}else

int n = da.length;

for (int i = 0; i < n; i++)

else if (da[i].tostring() == "佰" && da[i - 1].tostring() == "0")

else if (da[i].tostring() == "仟" && da[i - 1].tostring() == "0")

else if (da[i].tostring() == "萬" && da[i - 1].tostring() == "0" && da[i - 2].tostring() != "拾" && da[i - 2].tostring() != "佰" && da[i - 2].tostring() != "仟")

else if (da[i].tostring() == "億" && da[i - 1].tostring() == "0" && da[i - 2].tostring() != "拾" && da[i - 2].tostring() != "佰" && da[i - 2].tostring() != "仟" && da[i - 2].tostring() != "萬")

}da=da+one+"整";// da = da.replace("零拾", "").replace("零佰", "").replace("零仟", "").replace("零萬", "").replace("零億", "");

}//10 0000 0000 0000 0000

return da.replace("k","").replace("0","")+"";

}

大小寫轉換

problem description x現在要學習英文以及各種稀奇古怪的字元的了。現在他想把一串字元中的小寫字母變成大寫字元,大寫字母變成小寫字母,其他的保持不變。input 輸入有多組。每組輸入乙個字串,長度不大於80,不包含空格。output 輸出轉換後的字串 sample input a b...

大小寫轉換

a b c d這樣的52個字母 包括大寫 在計算機中儲存時也要使用二進位制數來表示。標準ascii碼使用7位二進位制數 剩下的1位二進位制為0 來表示所有的大寫和小寫字母,如下圖所示,可以看出字母對應大小寫的差值為32。來進行大小寫轉換吧。請用程式實現 輸入乙個英文本母char,判斷它是 大寫字母 ...

金額大小寫轉換!

把數字轉換成中文大寫金額,分以下小數截位 param dblmoney double 數字 param blnfull boolean false,2001.30 貳仟零壹元叄角整 true,2001.30 貳仟零佰零拾壹元叄角零分 param bzheng boolean 是否強制末尾加整字 如果...