0

So, I've been delving into JRuby this week just for fun, and I'm working on using SWT to create some pretty stuffs. Long story short, I grab a value from a List and it ends up as what I've deduced to be a Java String Array. Like this:

java.lang.String[asdf]@52e50599

I need to be able to get this into a standard Ruby string, but I can't for the life of me figure out how to actually get the String (asdf) out of the string array using Java methods or JRuby methods.

EDIT:

Here is the snippet of code that grabs the string above

list is a Swt::Widgets::List JRuby object

button is a Swt::Widgets::Button JRuby object

button.add_selection_listener do
  name = list.get_selection
end

Name ends up as the java.lang.String object

EDIT 2:

I'm certain I'm looking for the inverse of this:

JRuby Reference

EDIT 3:

This question is a duplicate of: Java Array in Jruby

2
  • Please show the code in question. I don't have any idea whether you're even seeing this in Java or Ruby. Commented Sep 6, 2013 at 2:29
  • Sorry about that, updated accordingly Commented Sep 6, 2013 at 2:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.