如何在java中创建Chr("&H" & "0D")
我需要使用这些字符作为分隔符,以便它们可以被exe文件读取。
在ASP中,我会这样做:Chr("&H" & "0D")
,我如何将它传递到java中?
Dim strSplit
strSplit = Chr("&H" & "0D")
Response.Write("Code=0" & strSplit & "CMoney=500000" & strSplit & "CNFlag=0" & strSplit)
在Java中
private final char cc = (char) 0D;
public String isClanMember(){
return "Code=2"+c+"CName=ClanTeste"+c+"CNote=Revanche Clans"+c+"CZang=xCaD"+c+"CStats=1"+c+"CMCnt=1"+c+"CIMG=1000000001"+c+"CSec=60"+c+"CRegiD=24/07/2015 ¿ÀÈÄ 20:24:44"+c+"CLimitD=01/06/2025 ¿ÀÈÄ 20:24:44"+c+"CDelActive=0"+c+"CPFlag=0"+c+"CKFlag=0"+c+"CMoney=0"+c+"CNFlag=0";
}
发布于 2015-07-25 03:30:46
char: char数据类型是单个16位Unicode字符。它的最小值为'\u0000‘(或0),最大值为'\uffff’(包括65,535 )。
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
forDigit(整型数字,整型基数)确定指定基数中特定数字的字符表示形式。http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html
所以Character.forDigit(97,10)应该返回'a‘
https://stackoverflow.com/questions/31622456
复制相似问题