第一次使用Regex语句。
我有java regex语句,该语句按模式将String拆分为一些字符列表。
String line = "F01T8B02S00003H04Z05C0.12500";
Pattern pattern = Pattern.compile("([BCFHSTZ])");
String[] commands = pattern.split(line);
for (String command : commands) {
System.out.print(command);
}
Run Code Online (Sandbox Code Playgroud)
上面代码的输出就像(018020000304050.12500)
其实我想要这样的输出,(“ F”,“ 01”,“ T”,“ 8”,“ B”,“ 02”,“ S”,“ 00003”,“ H”,“ 04”,“ Z “,” 05“,” C“,” 0.12500“)。
表示所需的输出同时包含模式字符和拆分值。
你能建议我吗?
我想使用Delphi程序进行HTTP请求.
我使用下面的代码,但我得到了一个名为"Undeclared identifier:TIdHTTP"的错误
我是Delphi的新手.
我请你帮帮我
function PostExample: string;
var
lHTTP: TIdHTTP;
lParamList: TStringList;
begin
lParamList := TStringList.Create;
lParamList.Add('id=1');
lHTTP := TIdHTTP.Create;
try
Result := TIdHTTP.Post('http://192.168.1.247:8001/test/test_api/', lParamList);
finally
lHTTP.Free;
lParamList.Free;
end;
end;
Procedure http;
begin
PostExample();
end;
Run Code Online (Sandbox Code Playgroud)