Solved

string parsing question

Posted on 2013-06-13
1
223 Views
Last Modified: 2013-06-14
I have Strings defined like so:
public final static String RED_LARGE = "red-large@";
public final static String TOP_RED_LARGE = "top-red-large@";	
public final static String BOTTOM_RED_LARGE = "bottom-red-large@";

Open in new window

The strings are appended with an int during runtime, so that values could be, for example:
red-large@2
top-red-large@2
bottom-red-large@3
These string values are assigned to a class, call it MyClass, via a class member called userString, so userString could be any of the above values or some orther value on the int.
What is the best way to determine if userString is a RED_LARGE (ie not TOP_RED_LARGE  or BOTTOM_RED_LARGE )?
0
Comment
Question by:allelopath
1 Comment
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39244733
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now