Questions tagged [tostring]

Ask Question

"toString" or "ToString" is a major formatting method or function used in high level programming languages. It converts an Object to its string representation so that it is suitable for display.

2,523 questions
0 votes 2 answers 32 views

How to print matrix?

public override string ToString() { string matrixView = ""; for (int r=0; r<=this.rows; r++) { for (int c=0; c<=this.columns; c++) { } } ... user avatar Ufuk Can İşbildi
  • 53
0 votes 0 answers 18 views

Hashset to string [duplicate]

Hi I am trying to display the content of a hashset which has different data types within it. I am using a different method to display the hashset. All i get is [FVC.Book@35bbe5e8] or this sort of ... user avatar Alanna McKelvie
  • 1
0 votes 1 answer 41 views

Unity Does StringBuilder.ToString() cause the heap memory allocating?

Today, I heard that .ToString() causes to call GC. And I have found there is StringBuilder, so I decided to use it. However, the StringBuilder doesn't fit to text, so I got to know that I had to use .... user avatar ISAAC KWON
  • 3
1 vote 1 answer 55 views

Why does my Android Dialog throw a NullPointer?

i've been struggling with a simple Android Dialog that I need in order to add elements to a list; it's pretty simple (an edit text, a spinner and a button), but when I try to show it it just keeps ... user avatar ChicoRafa
  • 11
0 votes 2 answers 37 views

Creating toString method in custom ArrayList Java

I'm creating my own ArrayList and stuck in the toString() method, can you help me get rid of the comma after printing the last item? toString() method: @Override public String toString() { ... user avatar Orest Dymarchuk
  • 49
3 votes 4 answers 155 views

Is show() the correct way to return a String representation of a struct?

In C# and Java, we have the toString() method to return a String representation of an object. The closest I've seen in Julia is show(), but I'm not entirely sure if it's the correct function. struct ... user avatar Mint.Hot.Chocolate
  • 343
0 votes 0 answers 9 views

Numeral system conversion in JS (error when typing a letter)

I have a converter (numeral system). Everything works fine, but when I am trying to convert duodecimal (12) to decimal (10) there is a problem. When I type "a" in duodecimals I have an error ... user avatar Gibon
  • 81
0 votes 0 answers 37 views

C# WinForm How to set date format in datatable?

I am new to C# and I am working on a project. I got a column that contained datetime from Excel, I am going to input the data into DataGridView via datatable. What I have in my Excel, ex: 2022/05/29 I ... user avatar Ritsuki14159
  • 13
0 votes 1 answer 34 views

How to make a String become one Number in lua script (Mine question IS not that simple)

I wanna know How to convert a number in one String,in lua script,but i know If do this Var = 10 , then the "var" Will be equal to 10 But my question is not simple I mean Literally transform ... user avatar Mateus Henrique
  • 1
1 vote 1 answer 58 views

Can you explain this double to string conversion behavior in C#?

I'm trying to figure out why this happens and what is C# doing here. Let's say we have a double: 277.3599853515625 (that's 13 digits after the period) Then 277.3599853515625.ToString() -> "277.... user avatar WorldOfConfusion
  • 21
0 votes 0 answers 12 views

i have stored database values in the variable called result it returns as [object Object] need to change to string format?

plz check out this code and help me to find the error the result i have returned in the table showing that only the object object. function makeTable(result) { var table = document.createElement('... user avatar Mr-innocent
  • 1
0 votes 1 answer 30 views

FLUTTER: When converting List<int> to List<String> error thrown: Unhandled Exception: type 'String' is not a subtype of type 'int' in type cast

This is bizarre, I'm trying to do a simple conversion of List to List sp I can save it to SharedPreferences (prefs) and it throws an exception. Unhandled Exception: type 'String' is not a subtype of ... user avatar Sam
  • 1,015
-1 votes 0 answers 56 views

Object's toString() simply doesn't print or return an error

I am trying to print an object with my toString() method and for some reason literally nothing happens (no error is returned and nothing is printed out). I've tried not using the toString and as ... user avatar iceninja21
  • 1
2 votes 2 answers 80 views

C# properties and "tostring" method

I was trying to understand properties better and I came across this page with this example: using System; namespace tutorialspoint { class ... user avatar Turtle
  • 29
-1 votes 1 answer 34 views

How to call tostring method on all objects

I have a school project where I have to make every tostring method appear on every object. Does anyone know how to do it? enter image description here enter image description here user avatar 19603
  • 1

15 30 50 per page12345169

You Might Also Like