Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Abt C# message handlers Pin
leppie28-Sep-03 1:08
leppie28-Sep-03 1:08 
GeneralRe: Abt C# message handlers Pin
Anonymous28-Sep-03 5:29
Anonymous28-Sep-03 5:29 
Generallinkbuttons and web spiders Pin
Member 52585827-Sep-03 19:19
Member 52585827-Sep-03 19:19 
GeneralRe: linkbuttons and web spiders Pin
leppie28-Sep-03 0:51
leppie28-Sep-03 0:51 
QuestionQuestion abount Socket Communication? Pin
JiangHaiLong27-Sep-03 19:12
JiangHaiLong27-Sep-03 19:12 
AnswerRe: Question abount Socket Communication? Pin
Corinna John29-Sep-03 2:33
Corinna John29-Sep-03 2:33 
QuestionHOW Can Run The SQLAGENT WITH Programe? Pin
meetweb27-Sep-03 15:23
meetweb27-Sep-03 15:23 
GeneralStrings in C# Pin
gmhanna27-Sep-03 15:15
gmhanna27-Sep-03 15:15 
I am trying to convert a routine from C to C#, that will scan over a character array converting the 1st character of every word to upper case. I mainly use this on peoples names.

In C it was very simple, I just loop over the characters and "AND"ed the byte with 0x20. In C# it wouldn't let me do that with strings, saying it was read only, so I tried copying it to a byte array, which kinda works.

I removed the 1st letter of each word logic to simplify the code. Now the code reads:

byte[] strout = new byte[255];
string workstr;
workstr = textBox1.Text;

for (int i = 0; i<textbox1.text.length; i++)
{
="" if="" (textbox1.text[i]=""> 0x60)
strout[i] = Convert.ToByte(workstr[i] & 0x20);
else
strout[i] = Convert.ToByte(workstr[i]);
}

textBox1.Text = Convert.ToString(strout);

What I am getting when trying to "AND" the 0x20 is just 0x20, it doesn't just turn off the bit. Also how do you convert the byte array back to a string? I have tried a couple of convert methods but haven't had much luck.

Thanks,

Glenn
GeneralRe: Strings in C# Pin
gmhanna27-Sep-03 15:18
gmhanna27-Sep-03 15:18 
GeneralRe: Strings in C# Pin
J. Dunlap27-Sep-03 15:48
J. Dunlap27-Sep-03 15:48 
GeneralRe: Strings in C# Pin
Daniel M. Edwards27-Sep-03 18:50
Daniel M. Edwards27-Sep-03 18:50 
GeneralRe: Strings in C# Pin
Bo Hunter28-Sep-03 7:32
Bo Hunter28-Sep-03 7:32 
GeneralRe: Strings in C# Pin
Daniel M. Edwards28-Sep-03 8:23
Daniel M. Edwards28-Sep-03 8:23 
GeneralTreeview Question Pin
Shahin7727-Sep-03 11:47
Shahin7727-Sep-03 11:47 
GeneralRegistry Pin
.gonad27-Sep-03 5:49
.gonad27-Sep-03 5:49 
GeneralRe: Registry Pin
Wjousts27-Sep-03 11:58
Wjousts27-Sep-03 11:58 
GeneralRe: Registry Pin
Daniel M. Edwards27-Sep-03 19:10
Daniel M. Edwards27-Sep-03 19:10 
Generalrtf to mark-up Pin
Anonymous27-Sep-03 4:25
Anonymous27-Sep-03 4:25 
GeneralRe: rtf to mark-up Pin
Anonymous27-Sep-03 4:26
Anonymous27-Sep-03 4:26 
GeneralRe: rtf to mark-up Pin
Daniel M. Edwards27-Sep-03 19:24
Daniel M. Edwards27-Sep-03 19:24 
GeneralRe: rtf to mark-up Pin
leppie28-Sep-03 1:00
leppie28-Sep-03 1:00 
GeneralRe: rtf to mark-up Pin
Daniel M. Edwards28-Sep-03 6:14
Daniel M. Edwards28-Sep-03 6:14 
Questionhow to call ShellExecute in .NET Pin
bugtwo26-Sep-03 23:35
bugtwo26-Sep-03 23:35 
AnswerRe: how to call ShellExecute in .NET Pin
Nish Nishant27-Sep-03 0:06
sitebuilderNish Nishant27-Sep-03 0:06 
GeneralRe: how to call ShellExecute in .NET Pin
bugtwo27-Sep-03 0:35
bugtwo27-Sep-03 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.