Questions tagged [object-to-string]

"Object to string" is the concept of canonically representing an Object as a String.

64 questions
0
votes
3 answers

Field with random int value

I'm writing a program that simulates simple bank account activities and I was wondering how to do it so that if I create a new Account without any parameters, it receives random 7digit identification number that is shown as String. The way I do, I…
Konrad
  • 3
  • 1
0
votes
1 answer

convert chars from a position in a char array through an other position into a string in java

So i have a string and an array of characters and what i want to do is make a string with some characters between two positions of this array. Ex. If Arr = {a,b,c,d,e,f} I want Str= "bcde"
icsd12015
  • 33
  • 1
  • 10
0
votes
1 answer

Matplotlib objects nodes, unicode __str___

I am very tired about all this unicode problems. I need to build graph with object nodes. And I need do show this graph. I have problems with visualization unicode strings. So... To make object as graph node, I need to override equal and hash…
user1113159
  • 603
  • 2
  • 6
  • 14
0
votes
3 answers

Using ToString on a DateTime object

In my database the date is stored like datetime but when I want to perform a search/filtering I want it to be based only on the date ignoring the exact time. I spend a lot of time figuring out how to do it and finally I got a working solution on my…
Leron_says_get_back_Monica
  • 8,874
  • 33
  • 135
  • 238
0
votes
3 answers

How to compare two StringBuffer Objects using .equals() method?

The following code did not work. Can anyone tell me what's wrong with the following code. Logically it should work... package assignments; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class…
Praveen Kumar
  • 41
  • 1
  • 1
  • 10
0
votes
0 answers

Regarding conversion of object into string in android

I have 1 class which includes a table consisting of 9 rowa and 9 columns.Table consists of header,value section and footer which includes total of all the data addition.I want to generate pdf for this table.I am taking a commonlayout object and…
Aditya
  • 115
  • 3
  • 14
0
votes
1 answer

Extracting strings from ListView Items, adding chars?

I have a listView that displays the records from a database, and a setOnClickListener() for the items that pulls the text from the list and adds the String as an extra for an Intent. This all works fine, my list displays records with Text such as,…
user1753360
  • 157
  • 1
  • 2
  • 10
0
votes
1 answer

Remove Json specific node

during run time I'd like to print JSon to log but censor one of its fields. I use JSon.Net and have all the attributes, for example public Class Terms { [JsonProperty("Term")] string term …
user1025852
  • 2,494
  • 9
  • 30
  • 54
0
votes
1 answer

iam having a issue when using .toString() on an item in the array with jquery

The probelm i am having is when using .toString() it does not work, but if I wrap the value with jQuery ($) then i get a jquery object instead. It would be good if there is a solution to both working with object.toString() or getting the value in…
n3tx
  • 429
  • 1
  • 8
  • 22
0
votes
5 answers

Convertion of user-defined object to string by toString not showing correct output

I have created a class CurrentDate which shows the system date in a particular format(e.g. 29-JUN-12). The class looks like : package getset; import java.util.*; import getset.Getset; public class CurrentDate{ public static void main(String[]…
Mistu4u
  • 4,475
  • 13
  • 44
  • 80
0
votes
2 answers

toString returning all of an objects getter methods

I'm using ColdFusion, but I'd be interested to know how other languages cope with this. Is there a better way of returning all of an objects variables (getters) without writing a massive toString() method on the object. variables.oCity =…
Jarede
  • 2,923
  • 3
  • 38
  • 55
-1
votes
2 answers

Java: Strange output with printstream, why toString doesn't convert?

I am not getting the result I expected when using toString on an object. (I have inherited the code). The goal is to print on a txt file the FiscalCode of a person. Here is my object: public class DatiPersonaFisica extends DatiPersona { private…
Pickeroll
  • 757
  • 2
  • 7
  • 18
-1
votes
3 answers

How to get rid of unwanted spaces after using ToString() in C#?

This might be a problem with Session and not ToString(), I'm not sure. I have two .aspx pages and I want to pass an IP address from a datatable from one page to the other. When I do this, spaces get added that I don't want. The simple version of…
user3634308
  • 117
  • 1
  • 3
  • 12
-1
votes
1 answer

Instantiate each object in an array - Java

I'm not getting any errors from the following code but my toString is returning null for the instance. Shoe shoe[] = new Shoe[10]; shoe[0] = new Shoe(); shoe[0].setPosition(12, 34); If I instantiate an object normally and call its setPosition the…