tostring Questions

4

Solved

I have a huge xml file (1 Gig). I want to move some of the elements (entrys) to another file with the same header and specifications. Let's say the original file contains this entry with tag <t...
Bogey asked 9/8, 2011 at 23:20

2

Solved

I would really appreciate someone help me resolving the following issue: I am getting now and then the following exception: Index was out of range. Must be non-negative and less than the size o...
Yakutsk asked 28/9, 2012 at 18:23

2

Solved

I have numeric objects a=1,b=2,c=3,d=4. Now when I use : toString(c(a,b,c,d)) I get: "1, 2, 3, 4" as the output. How do I get rid of the comma? I want "1234" as the output. Or is there anothe...
Glutenous asked 19/1, 2014 at 6:20

4

Solved

const num = 42 const str = `My number is ${num}` In this code what guarantee do I have about the conversion of num to a string ? Is it guaranteed to just call its toString() method or could the co...
Martian asked 22/6, 2020 at 14:36

15

Solved

I have a class defined as follows: public class Person { private String name; // constructor and getter/setter omitted } I tried to print an instance of my class: System.out.println(myPerson...
Spinks asked 19/3, 2015 at 8:59

4

Solved

I have tried this: public static class ListHelper { public static string ToString<T>(this IList<String> list) { return string.Join(", ", list.ToArray()); } public static string T...
Behah asked 13/2, 2011 at 4:49

3

Solved

I would like an easy way to print out a java object, or to say it another way, serialize an object as a string. I would like to see the values of all variables contained within the object, and if t...
Readership asked 14/4, 2011 at 20:32

3

Solved

In Swift, I can do something like this: let ordinalFormatter = NumberFormatter() ordinalFormatter.numberStyle = .ordinal print(ordinalFormatter.string(from: NSNumber(value: 3))) // 3rd but I do...
Benedic asked 20/1, 2017 at 21:31

27

Solved

My enum consists of the following values: private enum PublishStatusses{ NotCompleted, Completed, Error }; I want to be able to output these values in a user friendly way though. I don't need...
Personalize asked 26/1, 2009 at 10:58

4

Solved

So I just learned Integer.toString(int x, int radix); and thought it was pretty awesome since it makes base conversions super easy. However, I'm trying to write with Base-26 phonetically (a - z) a...
Pleuro asked 19/1, 2017 at 3:32

26

Solved

I have a vector<int> container that has integers (e.g. {1,2,3,4}) and I would like to convert to a string of the form "1,2,3,4" What is the cleanest way to do that in C++? In Python this ...
Napalm asked 16/9, 2009 at 3:14

16

Solved

When I console.log() an object in my JavaScript program, I just see the output [object Object], which is not very helpful in figuring out what object (or even what type of object) it is. In C# I'm...
Underclassman asked 10/6, 2011 at 14:8

17

Solved

Is there a way in JS to get the entire HTML within the html tags, as a string? document.documentElement.??
Cran asked 3/5, 2009 at 14:34

14

Solved

I am making a small vocabulary remembering program where words would would be flashed at me randomly for meanings. I want to use standard C++ library as Bjarne Stroustroup tells us, but I have enco...
Deannedeans asked 19/10, 2012 at 13:29

41

How can I convert a JavaScript object into a string? Example: var o = {a:1, b:2} console.log(o) console.log('Item: ' + o) Output: Object { a=1, b=2} // very nice readable output :) Item: [o...
Wilfredowilfrid asked 10/4, 2011 at 15:35

32

Solved

What is the easiest way to convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace?
Cloyd asked 19/7, 2009 at 11:31

10

Why does the second one of these produce an exception while the first one doesn't? string s = null; MessageBox.Show(s); MessageBox.Show(s.ToString()); Updated - the exception I can understand, t...
Kisumu asked 25/1, 2011 at 12:39

6

Solved

int a = 10000000; a.ToString(); How do I make the output? 10,000,000
Parulis asked 31/3, 2009 at 3:42

7

Solved

I would like to change decimal point to another character in C#. I have a double variable value double value; and when I use the command: Console.WriteLine(value.ToString()); // output is 1,25 ...
Broiler asked 28/6, 2010 at 19:39

6

I am trying to use IOUtils.toString() to read from a file. However, I am getting an error saying "IOUtils cannot be resolved." What am I supposed to be importing to allow me to use this function? ...
Fun asked 14/5, 2013 at 4:17

37

Solved

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the hashCode of the array, as defined by Object.toString(): int[] intArray =...
Pindus asked 3/1, 2009 at 20:39

5

I want to set in text view full value of Double without scientific notation (Exponential), what is best approach? I tried convert Double value using method toString() on it, but I still have scien...
Asymmetry asked 2/9, 2019 at 10:41

6

Solved

Ok guys, so I am trying to learn how to print out a linked list. I have all the methods that I would need to use for the list, but I can't figure out how to display the values of the nodes. Right n...
Paddie asked 9/10, 2013 at 21:28

8

Solved

I have a custom exception class which contains some additional fields. I want these to be written out in the ToString() method, but if I implement my own ToString(), I loose some other useful stuff...
Polis asked 11/12, 2009 at 8:24

26

Solved

In C#, what's the best way to get the 1st digit in an int? The method I came up with is to: turn the int into a string, get the 1st char of the string, and turn the char into an int. Like: int st...
Henghold asked 31/3, 2009 at 14:45

© 2022 - 2025 — McMap. All rights reserved.