#How to convert a string into a specific class object?

31 messages ยท Page 1 of 1 (latest)

tidal dockBOT
#

โŒ› This post has been reserved for your question.

Hey @obtuse cave! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

late flax
#

right because why would it be

#

why would "text" be a CategoryArray

obtuse cave
#

because for c it has to be a category array, or it won't let me store it into the CategorizedItemsArray. So I need it to be converted into CategoryArray instead of a String.

and .getText() is from getting the JFrame text field

late flax
#

then you need to turn it into a CategoryArray?????

#

why would you think we can help you with the minimal info you've given lol

#

i don't even know what "for c" is

obtuse cave
obtuse cave
late flax
obtuse cave
obtuse cave
late flax
#

we don't know what CategoryArray is ๐Ÿ’€

#

is it your own class

obtuse cave
late flax
#

then how do you expect us to know when you've shown literally none of it ๐Ÿ’€

obtuse cave
#

here it is

#

and from CategorizedItemsArray, i included the CategoryArray as an argument

late flax
#

so it doesn't match 1:1 to a string

#

how do you think the string should be turned into that

#

what ever it is, implement that

#

ask about help with the implementation

#

you are providing far too little info nor effort for anyone to actually help you

obtuse cave
#

i'm a beginner at this

late flax
#

right, but we don't either

#

we aren't psychic

#

at the very least, show an example of the input string and what each part maps to