月曜日, 8月 21, 2006

String.split() Function in Java

String.split() fundtion is quite handy in that it can set delimiters
in regular expression format. In order to obtain a list of fragments
of a string, supply an argument as follows.

str.split(" ");

In using Unicode, the whitespace can be set as follows.

str.split("\\p{javaWhitespace}");

In this way, whitespaces such as Japanese whitespace can be specified.

Some other figures are added to Java's regular expression than standard ones. The date expression such as 2006-08-22 can be specified in the format as follows.

String regex="\\d{4}-\\d{2}-\\d{2}";
String contents[]=text.split(regex);

Laravel サイトのアップグレード

 Laravel のサイトをアップグレードする機会がありましたので、その方法をここで書いておきたいと思います。かなり構成というか書き方が変わってきているので注意が必要です。 1. 新しいLaravelプロジェクトの作成 まずはクリーンなLaravel環境を作成します。 compo...