我正在尝试使用正则表达式匹配数字:
尝试:
[0-9-]+
[0-9]+[-]?:[-N]?[0-9]
Run Code Online (Sandbox Code Playgroud)
示例有效输入:
60-55-1
79-0,2,4,6,8,10,12,14,16,18,20,22,24,26
Run Code Online (Sandbox Code Playgroud) 我使用以下表单在php..im中构建文件上传/ dwnload应用程序
<html>
<head>
<title>Upload Index</title>
</head>
<body>
<form enctype=“multipart/form-data” action=“files.php” method=“post”>
<p>Choose your file to upload!
<input name="uploadedfile" type="file" />
<input type="submit" value="Upload">
<br />
And what would you like to call it? <input name=“title” type=“text” />
</p>
<p><br />
</p>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
而不是去"files.php"它指向一些奇怪的URL ...像这样:http://project360.in/%C3%A2%E2%82%AC%C5%93files.php%C3 %A2%E2%82%AC%C2%9D?uploadedfile = buglog.txt&%E2%80%9Ctitle%E2%80%9D =任何想法应该做些什么来解决这个问题?
我试图在String中连接String数组值,下面的代码不起作用
private void newString() {
String str = "Split me";
String[] tokens = str.split("[ ]+");
String newStr = new String();
for(int i=0; i<tokens.length; i++){
newStr.concat(tokens[i]);
}
System.out.println("NEW STRING IS : " + newStr);
}
public static void main(String[] args){
Main m = new Main();
m.newString();
}
Run Code Online (Sandbox Code Playgroud) 我有一个文本文件,必须进行处理.这些行包含国家名称和一些州,如下所示.我想把它放在一个数组中.是否有可以实施的馆藏?
if(line.contains("India")){
//add their states to the collections
}
Run Code Online (Sandbox Code Playgroud)
印度
卡纳塔克邦
泰米尔纳德
安德拉邦
巴基斯坦
卡拉奇
拉合尔
澳大利亚
堪培拉
Adelide
美国
纽约
华盛顿
新的Jersy