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

Replacing “ in a string

I am using SQL server 2000 as my data base and the col. which is holding this
data is of type “text” data type. When I am generating an HTML page by
getting data from data base, it is displaying a special character. when I am
trying to replace this “ character with " , the replace function of dot net
is unable to replace it.
Jan 17 '06 #1
3 1703
Can you just copy the lines you are using to replace the character?
Anand

Jan 17 '06 #2
Try something like:

Private Function ScanInput(InputStr as String) as String
'This function will scan the input string InputStr for special
characters (e.g. Chr(39))
'and replace them with the SQL escape-sequence to allow MSSQL
Server to handle the input properly.
If (InputStr.Length = 0) Then
Return Chr(160)
Else
ScanInput = Replace(InputStr, Chr(39), Chr(39) &
Chr(39))
End If
End Function

I think ' = Chr(39), " = Chr(34) and   = Chr(160). Run it when
you are about to save a string of text to the database.

Jan 17 '06 #3
But this way you will have to scan for all the special characters
If you have html string ready and works fine on the browsers and the
same you are storing in the Text datatype, I think it will return you
exact string.
Anand

Jan 18 '06 #4

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

Similar topics

4
by: C# Learner | last post by:
What's the "standard" way of replacing a character in a string? Obviously, I can't say "myString = character;" because strings are immutable... So what would be the "standard" way of doing this?...
7
by: VMI | last post by:
If I have the string "Hllo", how can I replace char () with an 'e'? I cannot use the String.Replace() fuction. It has to be by replacing one char with another. Thanks.
7
by: Ryan Taylor | last post by:
Hi. I have some code that dynamically generates a PDF and spits this content directly to the web browser. I use HTMLDoc to create the Pdf's from html. So the user can click on a button "Print...
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
1
by: WT | last post by:
Hello, I was using hastable to store collection of objects of the same class MyClass. I start replacing this hastable by a Dictionary<string,MyClass>....but I was storing this hastable in cache...
2
by: Alain | last post by:
Hi, I am working on a project where I need to convert international characters with acii values. Like Andr -> andre and Bjrn -> bjorn. How can I do this without replacing every single...
32
by: FireHead | last post by:
Hello C World & Fanatics I am trying replace fgets and provide a equavivalant function of BufferedInputReader::readLine. I am calling this readLine function as get_Stream. In the line 4 where...
0
by: Lakhi | last post by:
hi frnds, I need small help in String replacement I need to replace the text using replceAll() with Case-Insensitve . Is there any regular expression for this? i have this expression ...
2
by: gsuns82 | last post by:
Hi all, I have to replace accented characters from a input string with normal plain text.I have coded as follows. String input = ""; input=...
7
by: DarthBob88 | last post by:
I have to go through a file and replace any occurrences of a given string with the desired string, like replacing "bug" with "feature". This is made more complicated by the fact that I have to do...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.