473,394 Members | 1,935 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,394 software developers and data experts.

Spaces function

Hi

Is there a spaces(n) function equivalent in vb.net that returns a string of
spaces of length n?

Thanks

Regards
Nov 20 '05 #1
5 1045
Hi John,

S = New String(" "c, 20)

Note the little 'c' which denotes a character as opposed to a string.

Regards,
Fergus

ps. I'm betting this is one of, oh, 5 replies.
Nov 20 '05 #2
On 2003-10-15, Fergus Cooney <fi******@tesco.net> wrote:
Hi John,

S = New String(" "c, 20)

Note the little 'c' which denotes a character as opposed to a string.

Regards,
Fergus

ps. I'm betting this is one of, oh, 5 replies.


One

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #3
Hi Tom,

Yep, just the one! :-( I bet on the wrong horse - it was the 'vb.net
equivalent' that got the crowd gathering. But maybe there will be some
redundant additions in the morning, eh? Lol. Maybe you could add your version
of creating spaces just to cheer me up! ;-))

Regards,
Fergus
Nov 20 '05 #4
* "John" <jo**@nospam.infovis.co.uk> scripsit:
Is there a spaces(n) function equivalent in vb.net that returns a string of
spaces of length n?


\\\
Dim s As String = New String(" "c, 60)
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Well, you can use the PadLeft and PadRight methods that
string variables have in .Net. For example:

Dim str As String
str.PadLeft(10)

effectively creates a string of 10 spaces.
-----Original Message-----
Hi

Is there a spaces(n) function equivalent in vb.net that returns a string ofspaces of length n?

Thanks

Regards
.

Nov 20 '05 #6

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

Similar topics

6
by: Nathan Sokalski | last post by:
I am using ASP to read code from a text file that I am displaying on my page. Because I do not want the code from the text file to be executed, I used the Server.HTMLEncode() method to display it...
5
by: Marco Gallo | last post by:
I've been trying to get rid of extra spaces in a table that I created with addresses in it. For instance in a field called TEST, I got the following address: " 1 main st Apt A "...
11
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white...
6
by: Manan | last post by:
hello All, I have a simple question..I'm creating a tempString that contains my values then i'm adding to a ListItemCollection (). In my tempString i'm adding a spaces between each values it...
1
by: Anonieko Ramos | last post by:
> > > How to display multiple spaces in a dropdownlist webform1.aspx <asp:DropDownList id="DropDownList1" runat="server"></asp:DropDownList>
2
by: David | last post by:
Sent this to alt.php a couple of days back, but doesn't look like I'll get an answer, so trying here. I'm trying to convert a script to use friendly URLs, I've done this before, but my PHP...
8
by: Joe Cool | last post by:
I need to map several columns of data from one database to another where the data contains multiple spaces (once occurance of a variable number or spaces) that I need to replace with a single...
3
by: FunkHouse9 | last post by:
I'm working on a form to collect data in a textarea which and am trying to keep returns and spaces. I have a couple of functions that I Frankensteined together to replace returns with <br> and to...
3
by: bstjean | last post by:
Hi everyone, I am trying to find an efficient way to perform a special query. Let me explain what I want. Let's say we are looking for all description that match "this is the target". In...
5
by: brian.j.parker | last post by:
Hey all, I've noticed an obscure little quirk: it appears that if you use a login with trailing spaces on the name, SYSTEM_USER automatically trims those trailing spaces in SQL Server 2000, but not...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.