以下の**"My name is Hanako and I'm 26 y.o.(My familiy name is Yamada)."**を"単語 単語 単語"という風に、分割するために、"xxxxx"に入る正規表現を教えてください。
import java.util.regex.Pattern;
public class splitPractice {
public static void main(String[] args) {
String str = "My name is Hanako and I'm 26 y.o.(My familiy name is Yamada)."; Pattern p = Pattern.compile("**xxxxx**"); String[] result = p.split(str); for (int i = 0 ; i < result.length ; i++){ System.out.print(result[i] + " "); }
}
}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/22 08:28