java - String to Char Array and Char array to String Conversion -


In my program, I'm getting a string from the database result set and change it to four arrays like this:

  emp.nid = rs.getString ("nid"). ToCharArray ();   

There is no error in this section. The string has been successfully converted to four arrays, but I have another such code:

  nid_txt.setText (Emp.nid.toString ());   

This prints some weird text Why is this not original? Please help me

You are calling toString on four [] - and he handles implementation with object , so you char [] Get the class name, @ and then the hash of the object, instead, call string (four []) constructor:

  nid_txt.setText ( New string (emp.nid));    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -