2011-11-27 35 views
0

我一直在看這個http://blog.javia.org/assembly-java/,尤其是這個位#6:Don’t use String. Use char array instead. 有沒有人有這樣的存儲和檢索數據的例子?android編寫和讀取大量數組的最佳方式?

例如我有這樣

int[] myInts = new int[256]; 
int[] myotherInts = new int[256]; 
byte[] mybytes = new byte[someLength]; 
+0

這裏有一堆這樣的字符處理的例子** [這裏。](http://www.java2s.com/Tutorial/Java/0040__Data-Type/ExtractingasubstringasanarrayofcharactersusingthemethodgetChars.htm)** –

+0

@Zeke wtf do你認爲你正在編輯我的文章?非常感謝其他人:) – user1033558

+1

@ user1033558:我強烈建議你閱讀下面的內容:http://stackoverflow.com/faq#editing – Zeke

回答

0

本質陣列:

String text = "To be or not to be"; 

char[] textArray = new char[3]; 
text.getChars(9, 12, textArray, 0); 

您的字符串因此,所有的被存儲在一個陣列,並使用getChars()然後分別提取。

+0

非常感謝你 – user1033558

相關問題