String size

  • Thread starter Thread starter Shapper
  • Start date Start date
S

Shapper

Hello,

I have two string simple questions:
1. How to get a string size?
2. How to get the second character of a string?

Example: myString = "122"

Character = myString ( Second Character ) = "2"

Thanks,
Miguel
 
There are several ways to accomplish this, here is one way.

string myString = "122";

int length = myString.Length;

char c = myString[1];

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Separate String 3
Check if String is Empty 2
String to Enumeration 1
String 2
Remove first word of a string 2
Replace String 4
Regular Expression 1
String 1

Back
Top