比如我想把public static void main(String[] args) {}拆分成public
static
void
main
(
String
[
]
args
)
{
}怎么样写程序,下面是这个程序有点问题,请帮忙改正import java.util.regex.Matcher;import java.util.regex.Pattern;public class CPT
{
public static void main(String[] args)
{
deleteVowel(" public static void main(String[] args)'ddd'");
}
static public void deleteVowel(String str){
String vowel="v+.s+|\\p{Punct}|[a-z]";
Pattern p=Pattern.compile(vowel);
Matcher m=p.matcher(str);
while(m.find()){
System.out.println(m.group());
}
}
}
static
void
main
(
String
[
]
args
)
{
}怎么样写程序,下面是这个程序有点问题,请帮忙改正import java.util.regex.Matcher;import java.util.regex.Pattern;public class CPT
{
public static void main(String[] args)
{
deleteVowel(" public static void main(String[] args)'ddd'");
}
static public void deleteVowel(String str){
String vowel="v+.s+|\\p{Punct}|[a-z]";
Pattern p=Pattern.compile(vowel);
Matcher m=p.matcher(str);
while(m.find()){
System.out.println(m.group());
}
}
}
解决方案 »
- SSO登录权限管理
- 请java高手帮助,我在页面写一个Ajax把值传入后台,后台应该怎么写能把计算后的值传到页面了?
- ssh整合
- 根据WSDL文件生成java文件问题
- TOMCAT里的Tomcat Administration和Tomcat Manager有什么用
- 请问:在webwork里出There is no Action mapped for action name login这个错是怎么回事
- 关于struts配置数据池的问题请高手帮忙一下
- 一个初学者的巨大烦恼-tomcat配置问题!
- 请问如何对已存储过程进行调用(高分相送)
- 从数据库查询得到的数据怎么添加超链接?
- 用java+jdbc连接了access数据库,这样的东西可以放在linux上运行么?谢谢
- 求一份 Java log4j 详细配置 以及ImageMagick的用法 还有获取系统变量方法
package com.tur4.test;import java.util.regex.Matcher;
import java.util.regex.Pattern;public class Compiler {
public static void main(String[] args) {
String s = "public static void main(String[] args) {}";
Pattern p = Pattern.compile("\\w+|[\\(\\){}\\[\\]]");
Matcher matcher = p.matcher(s);
while(matcher.find())
System.out.println(matcher.group());
}}
package com.tur4.test;import java.util.regex.Matcher;
import java.util.regex.Pattern;public class Compiler {
public static void main(String[] args) {
String s = "public static void main(String[] args) {System.out.println(\"hello\");}";
Pattern p = Pattern.compile("\\w+|[\\(\\){}\\[\\]\\.;:]");
Matcher matcher = p.matcher(s);
while(matcher.find())
System.out.println(matcher.group());
}}