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

  • SEARCH
  • Home
  • 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 9095741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:40:52+00:00 2026-06-16T23:40:52+00:00

So I wrote a little section of code in a program of mine that

  • 0

So I wrote a little section of code in a program of mine that uses the split method to parse out and sort the individual components held within a string. Below is a sample of the code:

String[] sArray;

String delimiter = "*";

String test = "TEXT*TEXT*TEXT*";
String a = "";
String b = "";
String c = "";

sArray= test.split(delimiter);

a = sArray[0];
b = sArray[1];
c = sArray[2];

System.out.println("A is: " + a + "\nB is: " + b + "\nC is: " + c);

However, when I run this program, it returns an error stating that:

Dangling meta character '*' near index 0

So I googled this error and found it might be related to an issue with how * can be considered a wildcard character in regex. So I tried:

String delimiter = "\*"

But that just returned another error stating:

illegal escape character

Has anyone ran into this issue before or know how you are (if you are) supposed to escape * in java?

  • 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-16T23:40:53+00:00Added an answer on June 16, 2026 at 11:40 pm

    You also have to escape the backslash:

    String delimiter = "\\*";
    

    Because the string literal "\\" is just a single backslash, so the string literal "\\*" represents an escaped asterisk.

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

Sidebar

Related Questions

I wrote a little program that use activemq embedded broker. Program run on one
I wrote a little program that solves 49151 sudoku's within an hour for an
I wrote a little Python program that looks though a directory (and its subdirectories)
I wrote a little piece of code to expose my problem. public class date
i wrote a little addin, which does some formatting of my C# code. in
I wrote a little daemon in Perl that calls up FFMpeg to encode a
I wrote a little Haskell program to find the area of a triangle, primarily
I wrote a little program, which is working like a ping command(i use ICMPSendEcho2),
I wrote a little application that takes in some text and converts it to
I wrote a little javascript function that checks for a cookie when onFocus is

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.