Solved

string parsing question

Posted on 2013-06-13
1
229 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

624 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