.NETGURU
HELP: Replacing line breaks in a web form textbox
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngvb' list.


Jason Hick
-- Moved from [aspngfreeforall] to [aspngvb] by Tim Musschoot <Click here to reveal e-mail address> --

Hi!

I've got a textbox on a web form that I need to "clean up" before it gets
inserted into a database.
The code snippet below shows what I'm trying to do.....

Dim strAddress As String
strAddress = frmAddress.Value.Replace(chr(13), ",")

...but I get the error message: Name 'Chr' is not declared. (I know this is
probably because of the brackets)

Please can someone tell me how can I replace the line breaks/carriage
returns???

Thanks!

Jason

------------------------------------------------------
Jason Hick
www.needapresent.com

Reply to this message...
 
    
Bob Macleod
There are built-in constants vbCr and vbCrLf for this type of comparison.
There are other items of interest for processing delimited values too, such
as the Split function.

[Original message clipped]

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Reply to this message...
 
    
hassan.hussein@zurich.com

Hi

What classes are you importing to use the chr function? Do have
System.Text.Encoding imported?

Hassan

"Jason Hick"
<jason.hick@circa To: "aspngvb" <Click here to reveal e-mail address>
mundi.com> cc:
Subject: [aspngvb] HELP: Replacing line breaks in a web form textbox
03/07/2002 08:44
AM
Please respond to
"aspngvb"

-- Moved from [aspngfreeforall] to [aspngvb] by Tim Musschoot
<Click here to reveal e-mail address> --

Hi!

I've got a textbox on a web form that I need to "clean up" before it gets
inserted into a database.
The code snippet below shows what I'm trying to do.....

Dim strAddress As String
strAddress = frmAddress.Value.Replace(chr(13), ",")

...but I get the error message: Name 'Chr' is not declared. (I know this is
probably because of the brackets)

Please can someone tell me how can I replace the line breaks/carriage
returns???

Thanks!

Jason

------------------------------------------------------
Jason Hick
www.needapresent.com

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Reply to this message...
 
    
Remas Wojciechowski
Jason,

you have (at least) two options:
1. (preferred) use System.Environment.NewLine instead of Chr(13) [Chr(10)
might be required, too]
2. add Import Microsoft.VisualBasic to your code. It contains declarations
for pre-.NET VB functions etc.

hth
Remas
http://www.aspalliance.com/remas

----- Original Message -----
From: "Jason Hick" <Click here to reveal e-mail address>
To: "aspngvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 03, 2002 9:44 AM
Subject: [aspngvb] HELP: Replacing line breaks in a web form textbox

> -- Moved from [aspngfreeforall] to [aspngvb] by Tim Musschoot
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
 
System.Environment
System.Text.Encoding




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification