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

please what the following statements mean??

foreach (char c in textBox1.Text)
bits += Convert.ToString((int)c,2).PadLeft(8, '0');
Aug 21 '10 #1
2 1343
Christian Binder
218 Expert 100+
It means: take every character of the Text in the TextBox (foreach(char c in textBox1.Text)), take the integer-keycode ((int)c) of this character, convert it to binary string (Convert.ToString((int)c,2)), if this string is short than 8 digits, fill them up with 0's (...PadLeft(8,'0')) and append it to a string-variable called bits

References: Convert.ToString()
String.PadLeft()
Aug 23 '10 #2
thank you for your reply
Aug 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: root | last post by:
Hi group, Apologies in advance if this has been asked somewhere before, but I haven't managed to get anything from the Google archives - I've been getting introductory guides to C++ all day...
1
by: ravi | last post by:
I have created the following interest to calculate the interest for the following currency pairs. I have tried to combine them in macros using conditions but the next query that is run in the macro...
1
by: Tony Johansson | last post by:
Hello! What does the following text mean "When visual component are written in C# properties will appear in VS.NET as a property sheet"? //Tony
3
by: Frederiek | last post by:
Hi, What exactly does the following code mean? More specific, what are the colons for? Is this some kind of way to initialize the structure members? struct somestruct { unsigned char a:1;...
10
by: Thierry Lam | last post by:
What does the following macro mean, especially the << sign: #define hello(x) (( int64 ) floor( (double) x ) << 32) Thanks Thierry
3
by: rizzkhan | last post by:
Hello everybody, I am a bit confused about this operator -> could anybody explain this for me. The reason I am confused is that every document I read to get an explaination about it, explain it in...
5
by: prabu | last post by:
Hi all, I want to know, what does the value of the array in the following statement mean and How to print the content of the array SMB_Negotiate using printf? unsigned char SMB_Negotiate = ...
9
by: martien friedeman | last post by:
I have written this tool that allows you to look at runtime data and code at the same time. And now I need people to test it. The easiest way to see what I mean is to look at some videos:...
1
by: Fool | last post by:
Ok I was doing this project but now Im halfway stuck. This project contains 3 class at the moment. Im mainly trying to make this applet like the game pong. I have the paddle and a ball and background...
2
by: sameera das | last post by:
typedef struct nodeType{ int info; struct nodeType *next; } node; node *head;
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.