Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:46:57+00:00 2026-06-04T08:46:57+00:00

There is an issue using split() with curly braces String[] values = str_bj.split({); i

  • 0

There is an issue using split() with curly braces

 String[] values = str_bj.split("{"); 

i need to split string with { but it throws an error at runtime …….

Error::

05-23 16:01:30.232: ERROR/AndroidRuntime(6802): FATAL EXCEPTION: main
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.obj/com.obj.ObjectDemoActivity}: java.util.regex.PatternSyntaxException: Syntax error U_REGEX_BAD_INTERVAL near index 2:
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): /{
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):   ^
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.os.Looper.loop(Looper.java:123)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.lang.reflect.Method.invokeNative(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.lang.reflect.Method.invoke(Method.java:521)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at dalvik.system.NativeStart.main(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): Caused by: java.util.regex.PatternSyntaxException: Syntax error U_REGEX_BAD_INTERVAL near index 2:
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): /{
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):   ^
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at com.ibm.icu4jni.regex.NativeRegEx.open(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.util.regex.Pattern.compileImpl(Pattern.java:383)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.util.regex.Pattern.<init>(Pattern.java:341)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.util.regex.Pattern.compile(Pattern.java:358)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at java.lang.String.split(String.java:2044)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at com.obj.ObjectDemoActivity.onCreate(ObjectDemoActivity.java:21)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802):     ... 11 more

It seems to work OK with other characters, but not {

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:46:59+00:00Added an answer on June 4, 2026 at 8:46 am

    { is used to represent intervals in regular expression, you need to escape it, since String.split does use regular expressions.

    Use str_bj.split("\\{"); or str_bj.split("[{]");

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a well known issue when it comes to using .NET value types
I am trying to split up my code in classes. but there is a
I found that using String.substring is known for memory issues related to String.split .
Is there a way to sort a List<T> using a string like Name desc
I have a string \nbed.bed_id,\nbed.bed_label,\nbed.room_id,\nbed.pool_bed, nbed.record_state\n and I need to split it by white
Are there any race condition issues when using NSNotifications within a single thread? Here
I am wondering if there are any performance overhead issues to consider when using
I'm having a problem using UpdateModel(theModelToUpdate) causing concurrency issues. Basically whats happening is, there
I've touched on these issues before, but that was using a system with vs
There is issue, when Uploadify plugin desn't POST more than 1 parameter. Tried 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.