String的常見操作(面試題)

2022-08-21 07:03:17 字數 743 閱讀 3736

public

static string inverse

(string str )

return string.valueof(chars) ;

}

public

static

char findhighratechar(string

str)

}else

}return highratechar;

}

/*找最長對稱字串,應該重最大長度開始找,找到就返回

如果從最小開始找的話,效率好低,那找到乙個還要繼續找,直到找到最長的為止

如果找對稱的個數的話那就另當別論了,必須得所有都判斷

*/public

static string findmaxsymmetrystr

(string str)

}//如果對稱則返回

if(k == chars.length/2)}}

return

""; }

public

static

intfindsymmetrystrnum

(string str)

}if(k == temp.length/2)}}

return count;

}

String類相關的常見面試題

1.下面程式段的執行結果是?a public static void main string args a.true true b.true false c.false false d.false true 2.下面的程式建立了多少個物件?b public static void main stri...

常見的面試題

程序中的管道 pipe ipc通訊的一種機制,佇列就是基於管道來完成通訊的,但是管道是原生的通訊方式 在程序之間會產生資料不安全的情況,需要自己手動加鎖來處理 管道在資料傳輸過程中,還涉及到乙個埠管理,這個需要我們在 中做處理才能使用 更加完善 程序中的佇列 管道 鎖,程序之間的資料安全 程序中的訊...

面試題(八)vuex常見面試題

1.vuex 是什麼?怎麼使用?哪些功能場景使用它?答 有五種,分別是 state getter mutation action module state 基本資料 資料來源存放地 getters 從基本資料派生出來的資料 mutations 體積更改資料的方法,同步!actions 像乙個裝飾器,...