Format String help


Posted on 16th Feb 2014 07:03 pm by admin

I have a textbox where a person enters an application number. the application number is 10 characters in length:ex: 000012345A0256775434
My clients only want to enter in the numbers without the leading zeros. This is fine but I want to be able to take the numbers they enter and then add in the leading zeros. So essentially I want to format whatever string they enter to make sure they all conform to the 10 characters in length whereby the zeros are added in if it is not. I thought I could so something like this.textbox.ToString("0000000000"). But that doesnt seem to work. Any ideas.?

No comments posted yet

Your Answer:

Login to answer
252 Like 17 Dislike
Previous forums Next forums
Other forums

check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.

The method delivers er_changed_data.

a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complca

IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with

The IE or FF detector
Hello Friends,

Problem of today ( we seek for php help ) as following ,

we know all th

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

How to file_get_contents when login required?
Hello!

I am trying to read data from a page that you have to be logged into to view, I am try

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

How to write on database when a link is clicked?
Hi, I have a list of products in a gridview. When the link is clicked currently it takes to an ext

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash