Solved

string parsing question

Posted on 2013-06-13
1
226 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 75

Accepted Solution

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 63
tomcat administrtor 12 46
Android development question 2 37
Is there a simpler dropbox system? 10 19
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

776 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