473,382 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Padding string

Hi

Is there a way in access 97 to pad a string with spaces such that the
resultant string is always x characters long?

Thanks

Regards
Jan 29 '06 #1
2 11887
John wrote in message <#G**************@TK2MSFTNGP11.phx.gbl> :
Hi

Is there a way in access 97 to pad a string with spaces such that the
resultant string is always x characters long?

Thanks

Regards


I think the String function exists a97. Say you have a variable strTest
containint "hello"

strNewWar = strTest & String(20 - len(strTest), "@")

I think also the LSet statement could be used

strNewWar = "12345678901234567890"
LSet strNewWar = strTest

--
Roy-Vidar
Jan 29 '06 #2


strOut = Left$(strIn & Space$(x), x)

MS Access - A legend in it's own time.

*** Sent via Developersdex http://www.developersdex.com ***
Jan 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: vertigo | last post by:
Hello I have: struct packet{ byte type; /*my byte is unsigned char*/ int len; } struct packet *p = new struct packet; p->type=10; p->len=0;
8
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had...
2
by: Thomas Paul Diffenbach | last post by:
I'm trying to write a space efficient string (nul terminated array of char), storing the characters directly unless the number of characters is too large to be so stored, and storing a pointer to...
5
by: ywchan | last post by:
I would like to convert a string to a fixed length e.g. if fixed length = 10 'abc' -> ' abc' 'abcdefghijklm' -> 'abcdefghij' Is there any simple function in C# can perform this operation?...
0
by: Phil C. | last post by:
(Cross post from framework.aspnet.security) Hi. I testing some asp.net code that generates a 256 bit Aes Symmetric Key and a 256 bit entropy value. I encrypt the Aes key(without storing it as...
1
by: Rasko | last post by:
when i try to insert kind of text to my richtextbox from web (copy/paste) i can do it but after i wanted to update i can't do it . there is an errormessage appears (Input string was not in a correct...
14
by: Richard Maher | last post by:
Hi, Can anyone please show me a regular expression (or function or other) for padding out a string to a fixed number of bytes? At the moment I've got a var initialized to N spaces, where 'N'...
3
by: floppyzedolfin | last post by:
Hi there. I'm coding an encryption / decryption program. At this very moment, I think I should be pretty close from the end, but there's something blocking me on my way. There's a "Padding is...
52
by: marc | last post by:
Hello, Is it possible to right pad with "0" (or other character != blank) ? for example : 1 , length 10 ="1000000000" I've tried with sprintf but I can only left pad with "0" or right pad with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.