Return ASCII values for a given string
Wuw can i do a loop on a string to return the ASCII values of the string
"This is a Test"
as the ASCII values? 84, 104, 104, etc.
I am trying to move the following SQL Server function to c#.
-------------------------------------------
SET TEXTSIZE 0
DECLARE @position int, @string char(8)
SET @position = 1
SET @string = 'This is a Test'
WHILE @position <= DATALENGTH(@string)
BEGIN
SELECT ASCII(SUBSTRING(@string, @position, 1))
SET @position = @position + 1
END
GO
I can do it in VB6, but I am not sure how to do this in C#. I have researched a ton and I am still at a loss.
Thanks,
Sal
__________________
Sal
|