toupper

    3熱度

    2回答

    我有一個名爲LString(鏈接列表類),與我的其他節點類一起工作。我寫了一個toUppercase()方法,它遍歷字符序列並將小寫字母轉換爲大寫字母。 我的問題是返回類型,這是我編碼很多時遇到的一個問題。我不確定如何返回所需的LString類型,因爲即使我鍵入return LString,它也會將其識別爲變量並給出相同的不兼容類型錯誤。 這裏是明確的錯誤: LString.java:134: e

    0熱度

    3回答

    我試圖改變圍棋現有的字符串,但我不斷收到此錯誤「不能分配給new_str [I]」 package main import "fmt" func ToUpper(str string) string { new_str := str for i:=0; i<len(str); i++{ if str[i]>='a' && str[i]<='z'{

    1熱度

    3回答

    我有一個名稱的字符串數組,我希望所有名稱都在大寫字母中。 這是我的簡單代碼,但它對名稱沒有任何作用。 foreach (string x in names) { x.ToUpper(); Console.WriteLine("{0}", x); }

    1熱度

    4回答

    我正在進行一項練習,將字詞存儲在<vector>的string s中,然後將所有字母轉換爲大寫,並且每行打印出8個字。除了toupper()我的代碼的一部分,一切正常。這一切是: vector<string> words; string theWords; string word; while(cin >> word) words.push_back(word); for(a

    3熱度

    3回答

    我想創建一個酒店的用戶輸入一個字符(S,D或L),並應該與代碼進一步下來的程序線。我需要幫助轉換用戶輸入(無論他們輸入它的方式)以將其轉換爲大寫,以便我可以使用if語句來執行我需要的操作。 到目前爲止我的代碼如下: public static void Main() { int numdays; double total = 0.0; char roomtype,

    -3熱度

    2回答

    我怎麼能輸出這個當我使用Visual Studio的C#替換和toupper 姓 這裏是我的代碼: private void button1_Click(object sender, EventArgs e) { string input; input = comboBox1.Text; input = input.Replace("_", ""); la

    0熱度

    1回答

    正如標題所說,我的文本文件中幾乎沒有大寫字母,因此如果沒有首字母大寫,所有的句子看起來都不正確。這是我的代碼到目前爲止: //This program reads an article in a text file, and changes all of the //first-letter-of-sentence-characters to uppercase after a period a

    3熱度

    1回答

    在哈斯克爾源toUpper展望: toUpper c = chr (fromIntegral (towupper (fromIntegral (ord c)))) ... foreign import ccall unsafe "u_towupper" towupper :: CInt -> CInt 什麼是chr含義,以及u_towupper?我對foreign import

    0熱度

    2回答

    HI我有一個字符串,如{它是一個很好的一天!是不是}。我必須將每個單詞的首字母改爲小寫,但空格也應該在那裏。爲了改變大寫,我使用了下面的代碼,但我不知道如何包含空格。 的代碼是: set wordlist { Its A Very Good Day! Isn't It } set newlistupper [list] for {set i 0} {$i < [llength $wordl

    -1熱度

    1回答

    林與TOUPPER功能練習,但我可以做這項工作,總是在printf的點崩潰,所以我覺得爭論是壞,還是這樣。 #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> int main (void){ char pepito[10]; puts("\nTell me something