What is the correct regex to accomplish string split in java? -


i have string "50[=]test item" want split in java using string.split "50" , "test item". correct regex accomplish that.

any appreciated.

you need escape [, while splitting, special character in regex. need escape [ because starts character class. no need escape ]:

arrays.tostring("50[=]test item".split("\\[=]")); 

will give you:

[50, test item] 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -