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...
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...
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...
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...
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...
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 ...
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...
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
6
Solved
int a = 10000000;
a.ToString();
How do I make the output?
10,000,000
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
...
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?
...
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 =...
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...
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...
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...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.