proasp_howto thread: Case sensitivity when using Replace...
That did the trick, and its replacing the root of words even if they are
plural and what not. The only problem now is when I am referencing a
pronoun keyword (one that must be capitalized...) "The Internet" for
instance, is a pronoun. The replace skips it since its looking for LCase
terms... and if I change it to TextualCompare it messes the link up... and
of course, if I force EVERYTHING LCase, then I have no capitals
Anyone have any ideas on this?
On 03/21/00, "Robert Chartier" wrote:
> strThis = replace(lcase(strThis),lcase(withThis))
or use instr, mid, etc.. to find and replace the position with the new
as for your plurals, store the root word and no the alternatives. Then
when you're replaceing ensure you get the whole word and not just the
Some sort of hashing algorithm would work also. I think some M$ library
has something, but dont quote me on it!
From: Brandon Brownlee
Sent: Tuesday, March 21, 2000 4:26 AM
To: How To
Subject: [proasp_howto] Case sensitivity when using Replace...
I am developing a quick little function to replace keywords in a glossary
with linked keywords... The definitions are coming out of a database. My
problem is, the Replace function is case sensitive, or so it seems. I have
tried using TextCompare instead of BinaryCompare, and it works, except
the keywords have spaces in them, then it blows it up... (The Internet for
example...) Anyways, here is my existing code...
FUNCTION fncLinkMaker(Keyword, DefNum)
Dim Def, EncKeyword
SQL = "SELECT Definition"&DefNum&" FROM tblGlossary WHERE Keyword =
Set rsLink = connObj.Execute(SQL)
Def = rsLink("Definition"&DefNum)
SQL = "SELECT Keyword FROM tblGlossary"
Set rsKeyword = connObj.Execute(SQL)
Do WHILE NOT rsKeyword.EOF
EncKeyword = Server.URLEncode(rsKeyword("Keyword"))
IF rsKeyword("Keyword") <> Keyword THEN
Def = Replace(Def, rsKeyword("Keyword"), "<A
1, -1, 0)
fncLinkMaker = Def
I could do it sloppily, by doing two Do Loops, one on a regular keyword
another on LCase(Keyword), but this still wouldn't cover all of them. I
thought I'd see if anyone had a more graceful answer, and learn something
new. Thanks in advance!
You are currently subscribed to proasp_howto.