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

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

Page Reload
I am having issues getting a page to reload after I submit data to a database. This form should inp

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to a

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possibl

Error In Syntax
I got this error:

Code: Parse error: syntax error, unexpected '>' in /home/bucket/publ

Variables and Include
Code: [Select]<?php

$header = $_COOKIE['mss']['header'];
$body = $_COOKIE['mss']['b

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