C 字串的簡單用法

2021-08-25 13:05:24 字數 775 閱讀 6927

下面的**實現的功能:

輸入email郵箱,獲取郵箱的使用者名稱。

輸入帶空格的字串,分割並連線。

輸入大寫英文本母轉換為大寫。

using system;

class program",email);

int intindex=email.indexof("@");

if(intindex>0)

else

console.writeline("請輸入乙個字串,單詞用空格分隔");

inputstr=console.readline();

console.writeline("您輸入的字串是",inputstr);

splitstring=inputstr.split(' ');

foreach (string s in splitstring)

joinstring=string.join("-",splitstring);

console.writeline("連線後的字串為",joinstring);

console.writeline("請輸入大寫英文本串");

strenglish=console.readline();

console.writeline("您輸入的大寫字母是",strenglish);

console.writeline("轉換為小寫英文本母是",strenglish.tolower());

console.readline();}}

注意:大小寫只適用於字母,漢字是不存在大小寫轉換的。

C 字串的簡單用法

下面的 實現的功能 輸入email郵箱,獲取郵箱的使用者名稱。輸入帶空格的字串,分割並連線。輸入大寫英文本母轉換為大寫。using system class program email int intindex email.indexof if intindex 0 else console.wri...

oc中字串的一些簡單用法

main.m 6nsstring created by 4 5 on 13 8 18.字串為我們封裝了許多可以直接拿來用的方法比如,獲取字串的長度,字串的比較,字串的拼接,查詢,擷取等 import int main int argc,const char argv nsstring str3 he...

mysql的簡單用法 mysql簡單用法

刪除使用者 drop user jack drop比delete刪除的優勢在於drop可以刪除使用者的許可權,更加徹底 更改使用者名稱 rename user jack to jacknew 使用者的都存在與user表中,更改名稱,許可權不變 更改使用者密碼 update mysql.user se...