1.string to inputstream
string str = "string與inputstream相互轉換";
inputstream in_nocode = new bytearrayinputstream(str.getbytes());
inputstream in_withcode = new bytearrayinputstream(str.getbytes("utf-8"));
2.inputstream to string
方法1:
public string convertstreamtostring(inputstream is)
} catch (ioexception e) finally catch (ioexception e)
}return sb.tostring();
}
方法2:
public string inputstream2string (inputstream in) throws ioexception
return out.tostring();
}
方法3:
public static string inputstream2string(inputstream is) throws ioexception
return baos.tostring();
}
String與string的區別
1 string是乙個類,string是一種資料型別.2 string是c 中的類,string是.net framework的類 在c ide中不會顯示藍色 3 c string對映為.net framework的string 4 如果用string,編譯器會把它編譯成string,所以如果直接用...
string與string標頭檔案
先來段 我是在vs2012上實驗的 include stdafx.h include include include using namespace std int tmain int argc,tchar argv cout endl for rit mapstudent.rbegin rit m...
String與string的區別
c 是區分大小寫的,但是我卻發現c 中同時存在string與string,於是我很困惑,於是我上網搜尋了一下,於是我了解了一些小知識。msdn中對string的說明 stringis analiasforstringin the net framework。string是string的別名而已,st...