im having some troble declaring strings in Visual Studio .Net, could some one please give me the standard form for this in .Net. Im using the strings lib. any help would be great... thanks in advance
im having some troble declaring strings in Visual Studio .Net, could some one please give me the standard form for this in .Net. Im using the strings lib. any help would be great... thanks in advance
//editCode:string s; //A reference s = new string();
sorry, that was c# code
Last edited by The Dog; 05-22-2003 at 05:38 PM.
Code:/* I had things on my mind so this was a good way to help you and get them off for a bit */ #include <iostream> #include <string> using namespace std; int main() { /* Declare a string of un-specified length. We can also do string userName[sumvalue] */ string userName; /* Read in the string from user */ cout << "Your Name: "; cin >> userName; /* As is */ cout << "Original string: " << userName << endl; /* Check to see if the first letter in string is lowercase. If it is, lets capitalize it! */ if((userName[0] > 97) && (userName[0] < 122)) { userName[0] -= 32; } /* Changed */ cout << "Capitalized: " << userName << endl; return 0; }
You are aware that this declares an array of strings, right?We can also do string userName[sumvalue]
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law