Solved

string parsing question

Posted on 2013-06-13
1
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
add projects t working set in maven 2 71
servlet and mdb, jms error 1 82
restrict decimal places for double datatype 10 49
Overriding a method 3 13
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

751 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