Commonly refers to a number of methods to display an arbitrary number of varied data types into a string.
-6
votes
3answers
26 views
A date is entered in TextBox how to code to return ddmmyyyy format [on hold]
when i enter date in text box like this: 2/2/1998
i want my date to appear like this
02021998
ToShortDateString() return like this: 02/2/1998
0
votes
1answer
8 views
Resolving subclass extension method when iteration over base class collection
I have a model, deserialized from XML, in which all node objects derive from the same base class, and nodes can be nested (somewhat) arbitrarily. I am trying to write a collection of modules which can ...
0
votes
2answers
23 views
CSVReader cannot read a line correctly
I have a .csv file with 12 columns and read the file with CSVReader class.
List<String[]> rows = reader.readAll();
But I found some String[] have less than 12 elements. When I debugged, I ...
1
vote
2answers
37 views
Efficient conversion of int to string
I've seen several questions/answers here that suggest the best way to get a string representation of an integer in Objective-C is to use [NSString stringWithFormat:@"%d", x]. I'm afraid the C/C++ ...
2
votes
4answers
79 views
String.Format for a specific use case
I'm looking for a String.Format() specifier in the .NET Framework that will permit this:
-- For values ranging between 0 and 1, a leading number (0 or 1), the decimal separator, and three digits ...
0
votes
4answers
32 views
Using String Formatting to pull data from a dictionary
How do I use string formatting to call information from a dictionary?
Here's what I attempted so far (probably quite bad...)
value = raw_input("Indicate a number: ")
print number_stats["chm%"] % ...
0
votes
1answer
18 views
Color is lost after adding string format
I need to add some text in a textview with some text with red color and some are black color with a specific formatting
Spannable wordtoSpan = new SpannableString(temp.substring(start, i));
...
1
vote
1answer
20 views
How do I get formatted value of environment variable
In my webapplication I want to allow administrators to execute system commands like:
Process proc = Runtime
.getRuntime()
.exec("cmd.exe /C dir C:\\\"Program Files ...
2
votes
1answer
42 views
Unexpected format string behavior
I just ran into what seemed to me to be bizarre string formatting behavior in python. It turned out to be caused by carriage return characters ('\r') I didn't know were there. Here's an example:
...
0
votes
3answers
45 views
Decimal to String Formatting [duplicate]
I try to convert (Decimal)0.9975 to string with (0.##) format in C# but it rounds the number to 1 instead of 0.99
Here is the code;
decimalValue.ToString("0.##");
How can I write the output as ...
0
votes
3answers
40 views
How can I split a string given a specific format?
I have dates in string format that sometimes are like this: 05-11-2009 16:59:20 and sometime are like this: 2013-12-05T22:00:00:00Z and some other time are like this: 2013-12-05T22:00:00:00.000Z.
I ...
3
votes
5answers
105 views
String formatting in C#
I'm working my way through a string formatting "cheat sheet", so that I can see how different string formatting arguments affect the string output. Whilst working with DateTime string formatting ...
0
votes
1answer
38 views
Preserve text formatting in coldfusion string
I have a coldfusion db field string called #text1# which is formatted with spaces and line feeds to display nicely as follows:
<b>FINDINGS:</b>
The house is red.
The tree is green.
...
0
votes
1answer
45 views
Fixed-width floating point number format
In Java, I have the following code:
System.out.printf("%05.5f", myFloat);
This works well for any numbers which are less than 10, but for any number 10 or greater, the decimal places are trimmed ...
5
votes
2answers
80 views
How can I add the thousands comma separator to this string format: (%0.2f)?
I am working with OpenRPT report writer and am trying to add the thousands comma separator for a field and the example they provide is %0.2f which I believe to be Python syntax. This is formatting ...