Working with Strings - 12
- Posted: Nov 21, 2011 at 9:14 AM
- 51,576 Views
- 25 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Like strings, dates and times are represented using special types, and so deserve some attention. In this lesson we learn how to work with Date and Time data, how to create new instances of DateTime, how to add time, format the data for display, and more. Furthermore, we discuss the TimeSpan class as a means of representing a duration of time.
Already have a Channel 9 account? Please sign in
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Great videos - we're recommending them to our students. Thanks.
Those are BACK-slashes, though, aren't they?
Rob
I'm really enjoying learning from this series. Very well presented.
I'd just like to point out that the description and link on this page refer to the next video.
@Rob ... Oops .. let's hope that's my ONLY mistake.
Just to point out, the description of this video is the same as video 13. It doesn't really apply to video 12.
On another note, great video!
Sir in this series do have you covered the complete concepts of object oriented programming too?? Like the tutorial on www.learnvisualstudio.com??
@Arwen: Thanks for the heads up ... I'll make sure the good folks at Channel9 see this issue. Thanks again!
@Naqi Agha: Object Oriented Programming (beyond the absolute basics) was NOT covered in this Channel9 Fundamentals series. I do talk about classes, properties, methods, and inheritance in this series, but I don't really address the OOP thought process here. Sorry, it just wasn't in the scope of what the Channel9 team was looking for.
@BobTabor: Hi Bob, Won't we get intellisense inside the formatting string for currency, numeric and etc, after pressing the semicolon like {0: ?
Hello Bob,
the link of code of lesson 12 target to code of lesson 13.
Hi Bob,
I love your style and I can easily follow you. These videos are excellent especially for a beginner like me in C#. Can you kindly direct me to a lesson which will teach me how to read html tables from a webpage and then use these numbers in further calculations. Does a string become a number?
Thxs
J
@thens: Probably so ... Intellisense should guide you (even if it didn't show up in the video I created ... ??)
@Jose Roberto: Unfortunately that's not something I can fix ... you will need to get Microsoft's attention by clicking the Feedback link in the Footer of this site so they can repair the links. Thanks for the heads up.
@jake123: Thanks for the kind words ... I don't have a free lesson on scraping a website, but I know there are a bunch of articles out there on the web that describe the technique. It definitely can be done. Search for terms like "web page scraping C#" or the like. Best wishes!
When I download the source code I get Date and Times not Strings??
@bill: Thanks, that is something Microsoft / Channel 9 will need to fix. I'll bring that to their attention. Thank you again.
the source code should be fixed. thanks for letting me know.
http://blogs.msdn.com/b/csharpfaq/archieve/2004/03/12/88415.aspx
is not acessible
is there a way to trim the spaces in between words?
say "hello world"
@Krati: Bummer ... I hate when that happens. Try searching in your favorite search engine for the keywords ... I'm sure they just moved it somewhere new.
re: Spaces in between words ... there are probably several ways to accomplish this. I'm not in a code editor, but you would do something like this (syntax might be off a bit):
var myNewString = myOldString.Replace(" ", " ");
Note ... I would send in the "bad" string (with two spaces between double-quotes) as the first parameter, and the "good"string (with one space between double-quotes).
If you need to be more selective, you might need to turn the entire string into a char array and loop through every character in the string looking for a sequence that fits the criteria you need. That would allow for a pretty advanced case, but would be code intensive. Hope that helps!
it is my pleasure writing you,really your video lectures helped me a lot.thanks a lot.
Thanks Bob for This lesson...I learn somethings.
Wow this is helping me learn c# so much. I am coming from PHP and recognizing alot of similarities.
Hah, funny. If for whatever reason you want 2 backward slashes you'd have to type c:\\\\. If you just input 3, you get the squiggly line.
Thanks a lot Bob,This is helping me a lot :)
This series is a lot of help. Thank you and your team.
The below code is not working for me.
StringBuilder myString = new StringBuilder(); for (int i = 0; i < 50; i++) { myString = myString +"--"+i.ToString(); }Getting below error:
Cannot implicitly convert type 'string' to 'System.Text.StringBuilder'
http://msdn.microsoft.com/en-us/library/system.string.aspx
Hi Bob,
I am a beginner and find your videos extremely informative and helpful.
I have a doubt regarding the way while loop functions, how is the while function able to move onto the next line in the txt file with out us telling it to. I mean in the for loop we have to increment the value everytime the loop finishes and so it moves on to the next.
Remove this comment
Remove this thread
close