Let's say you have some regex metadata with a conversion character like d. What is the purpose of the digits or integers that we sometimes see directly preceding the conversion character?(example: "%*4d/d" )
Marcus Deviln wrote:Let's say you have some regex metadata with a conversion character like d. What is the purpose of the digits or integers that we sometimes see directly preceding the conversion character?(example: "%*4d/d" )
Regex metadata? Conversion character? Can you first explain to us what you mean?
+ 1 with David. Marcus, can you post your problem/requirement in detail?
Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
4
posted
0
Look at the Formatter class or these sections in the Java™ Tutorials: 12 and 3. I can't seem to find the * character in Formatter, however. Are you sure about that?
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
9
posted
0
Campbell Ritchie wrote:Look at the Formatter class or these sections in the Java™ Tutorials: 12 and 3. I can't seem to find the * character in Formatter, however. Are you sure about that?
Maybe it's not supported in Java, but in C, the '*' character allows you to specify the field width in the argument list
From the MS C++ docs
The second optional field of the format specification is the width specification. The width argument is a nonnegative decimal integer controlling the minimum number of characters printed.... If the width specification is an asterisk (*), an int argument from the argument list supplies the value.
Joanne
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
4
posted
0
Joanne Neal wrote: . . . Maybe it's not supported in Java, but in C, . . .
No, it's not supported in Java, but thank you, Joanne. I had never seen that, not in the little C I have written.