We help IT Professionals succeed at work.

How to create a string in C# with ASCII characters outside of normally typed on keyboard

AndrewJen
AndrewJen asked
on
2,179 Views
Last Modified: 2013-11-07
I need to create a string that includes ASCII characters such as CHR(13) carriage return.

My code snippet below may help to explain my desired outcome. In this instance I'm looking to start my string with ASCII(10) and finish it with ASCII(13).

I'm using the .Net Framework ver. 2.


String matedata = "";
            matedata = ASCIIEncoding(10)+ "A,,,,12,12,15,245,,,,10,222,00,245,,,,,,,,,200" + ASCIIEncoding(13);
            serialPort1.WriteLine(matedata );

Open in new window

Comment
Watch Question

Director of Information Technology
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.