|
So in my case I have a table which contains 6 colomns which corresponds to a code and its value, and this table contains the characteristics of this value with format.donc to read a file from the code and its value must be correctly formatted according to the table, so I need to specify the format in 10 alpha numeric, so how do this??
|
|
|
|
|
I would recommend a validation process. If you try to format the return you will get spurious results.
Try using Regular Expressions to validate the value. ^[a-zA-Z0-9]{10}\z should do the job.
|
|
|
|
|
I believe this should do it.
myString = myString.PadLeft(10);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
If you want "10a" (as opposed to " a"), you would use
myString = string.Format("10{0}", a);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
It's unclear what you are asking; please provide "before" and "after" examples.
|
|
|
|
|
myString = myString.PadLeft(10, '0');
would keep it all-alphanumeric.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
string.Format("{0,10}", "a")
|
|
|
|
|
that fills with spaces, one could argue the result isn't all alphanumeric.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thank you very much to all of you, I'll try all these proposals and I will post the solution works
|
|
|
|
|
So we must convert the type specified by theFormatting Numeric Results Table []
that correct??
modified on Friday, May 21, 2010 1:04 PM
|
|
|
|
|
Dude - only you know the requirements.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
i need source code for simple user login page
|
|
|
|
|
I need a couple of million pounds sterling.
You help me; I'll help you.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
So, you think we will do it for you??
Be an Eagle, Sky is Yours.
|
|
|
|
|
Hello, you must be new here. Can you please read the thread at the top of this forum entitled "How to get answer to your question".
Thanks
|
|
|
|
|
Does your employer know that you don't have any idea how to program? Worse, that you can't even be bothered to try and figure it out: you just want other people to do your work for you.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
If this is for an ASP.NET page, just drag the login control onto the page. So simple that even you should be able to cope with it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete, this guy couldnt cope with downloading a zip file (see post below) - you think they can cope with dragging a complex (!) usercontrol onto an asp.net page? You crazy man!
|
|
|
|
|
Are you saying he couldn't pour piss out of a boot, even if the instructions were written on the heel?
Are you saying you're surprised the guy can even breathe on his own without constant verbal guidance?
Are you saying that when god was handing out brains, he thought they said "trains", and he said he'd rather take a cab?
Are you saying he's got the IQ of a two-slice toaster?
Are you saying that he doesn't know much, but he leads the world in nostril hair?
Are you saying that his golf bag doesn't contain a full set of irons?
Are you saying that his mind is so open that the wind makes a wistling sound as it passes through his ears?
Are you saying that if he ever had an idea, it would be beginner's luck?
Are you saying that he's a waterbug on the surface of life?
Are you saying that when he opens his mouth, he subtracts from the sum of human knowledge?
Are you saying that when you look into his eyes, you get the feeling that someone else is driving?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
He's saying the OP can't even spell IQ.
He's saying that the OP was thrown out of the genepool.
He's saying that the village called. Apparently they wanted their idiot back.
He's saying that when the OP leaves the room, it's as though somebody else has come in.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Are you saying he couldn't wipe his own arse without a map tattoed on his thigh?
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
I'm living on the wild side of life here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
...and I need a blowj...
Oh wait - this isn't youporn.com.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Do a search on the internet.
You should find many examples.
My signature "sucks" today
|
|
|
|
|
In addition to that being a stupid question, this is not even the right forum for it.
Harvest some more 1-votes in the ASP.NET forum.
|
|
|
|