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 4005644
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:25:07+00:00 2026-05-20T08:25:07+00:00

Greetings, I am the program writer for the rebellion against the evil galactic empire.

  • 0

Greetings, I am the program writer for the rebellion against the evil galactic empire. Right now, we are preparing for a daring assault on the Death Star.

I have created a vast database of information about our pilots, droids, and systems aboard our X-Wing and Y-Wing fighters that will soon assault the Death Star. Because of our critical needs to access the information quickly, I have designed a system where a user can enter a string of text to specify what data they want to retrieve.

There are numerous fields the user may search by. For example, if a user wants to find data about R2D2, he could type in the query “DROID:R2D2” and quickly find this data. If he needs the data about all the pilots, droids, and systems for Red Team, he could enter “TEAM:RED TEAM”.

However, the system is designed to handle more complex queries. As you can see from the previous query, the data field name and data value are seperated by a colon : character. The users must be able to search multiple values per field and search multiple fields all at once.

Here is a query typical of my more advanced users:
“SHIPTYPE:X-WING,Y-WING; LOCATION:docking bay 94; DROIDTYPE:R2”

I am quite happy with the way I have handled this.
I use the String.Split(';') function to read to get the values of the three data fields the user has selected. I use String.Split(':') to seperate the data field name from the value, and then I userString.Split(‘,’)` to get the different field values where the user has entered more than one. You can see how this works.

However, there is one problem. Princess Leiah (You know how fussy she is) insists on using ‘:’, ‘;’, and ‘,’ in her blaster calibration records. When she tries to query this data, her queries are unintelligible to my program. She says that the Death Star will destroy the rebel base soon if this problem is not corrected.

Therefore, I ask for you help in suggesting good practices for parsing user inputs. How can I get my program working for Princess Leiah?

Update I will speculate about the answer to my own question. When I learned to program in C-flavored languages, I learned about “escape-sequences” where I can specify an ordinarily reserved character in my string literals. (eg, A ” character ordinarily terminates a string literal, but I can “escape” it using \”) I’m guessing that it would be a good idea to do something similiar with my program, but I don’t know what would be the best way of accomplishing it. Prior to preparing for this Death Star assault, most of my programming experience has been with the binary language of moisture vaporators, so this is new to me.

  • 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-05-20T08:25:08+00:00Added an answer on May 20, 2026 at 8:25 am

    I’m sorry but the Star Wars description didn’t help to clarify your question.

    At any rate, I’ve written a lot of parsing code. I don’t care much for String.Split() unless the data will always be formatted just so. There is a general-purpose parser class at http://www.blackbeltcoder.com/Articles/strings/a-text-parsing-helper-class. I would probably use something like that to implement a more flexible parser.

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

Sidebar

Related Questions

Greetings I have a program that creates multiples instances of a class, runs the
greetings, i am writng a socket program using sockets in c# (asynchronous). the issue
Greetings, Forum. I'm working on a program in Python that uses Twisted to manage
Greetings, coders, Background Info and Code I am trying to create a daemon-type program
Greetings fellow enthusiasts: I am debugging a program integrated with the twitter-api where the
Greetings fellow enthusiasts: I am debugging a program integrated with the twitter-api where the
Greetings, my program exits with the code 3. No error messages, no exceptions, and
Greetings all, I’m working on a C# program that requires being able to get
Greetings, I'm trying to write a program in Python which would print a string
Greetings.... I am writing a backup program in c# 3.5, using hte latest DotNetZip.

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.