Click here to Skip to main content
15,354,717 members
Home / Discussions / C#
   

C#

 
AnswerRe: MonthCalendar - Adding a date without having the month or year. Pin
#realJSOP17-Dec-21 2:40
mva#realJSOP17-Dec-21 2:40 
Questionre-create a local database Pin
steven_noppe15-Dec-21 20:04
Membersteven_noppe15-Dec-21 20:04 
AnswerRe: re-create a local database Pin
OriginalGriff15-Dec-21 20:54
mveOriginalGriff15-Dec-21 20:54 
AnswerRe: re-create a local database Pin
#realJSOP16-Dec-21 2:39
mva#realJSOP16-Dec-21 2:39 
GeneralRe: re-create a local database Pin
jschell23-Dec-21 5:50
Memberjschell23-Dec-21 5:50 
QuestionHow do i gate the previous values in Crystal repor Pin
remiki14-Dec-21 7:37
Memberremiki14-Dec-21 7:37 
AnswerRe: How do i gate the previous values in Crystal repor Pin
remiki16-Dec-21 0:56
Memberremiki16-Dec-21 0:56 
QuestionParse from string Pin
Member 1546737514-Dec-21 4:00
MemberMember 1546737514-Dec-21 4:00 
Let's write our own Point class
C#
using System;
namespace PointNamespace
{
    public class Point
    {
        public int X{get;set;}
        public int Y{get;set;}
        public Point(int x = 0,int y=0)
        {
           X = x;
           Y = y;
        }
        public bool TryParse(string s,out Point p)
        {
            // Here is code for your function
        }
        public override string ToString()
        {
           return string.Format("({0},{1})",X,Y);
        }
    }
}


How can I write TryParse method
I would like to use methods like
string.Trim() ,
int.TryParse(string s, out int d),
string.IndexOf(); // Here is few overloads and which should I choose
string.Substring(int startIndex,int length);
Format of parsed string is shown in ToString method

Suppose we want also version for double coordinates
how method TryParse should look like then
In my native language comma and dot are switched in meaning when displaying
numbers and C# includes that
AnswerRe: Parse from string Pin
Pete O'Hanlon14-Dec-21 5:21
mvaPete O'Hanlon14-Dec-21 5:21 
GeneralRe: Parse from string Pin
jsc4214-Dec-21 6:55
professionaljsc4214-Dec-21 6:55 
AnswerRe: Parse from string Pin
#realJSOP15-Dec-21 0:35
mva#realJSOP15-Dec-21 0:35 
GeneralRe: Parse from string Pin
jsc4215-Dec-21 0:49
professionaljsc4215-Dec-21 0:49 
GeneralRe: Parse from string Pin
#realJSOP15-Dec-21 6:54
mva#realJSOP15-Dec-21 6:54 
Questionc# Search in root/subtree active directory users Pin
jwradhe9-Dec-21 2:10
Memberjwradhe9-Dec-21 2:10 
AnswerRe: c# Search in root/subtree active directory users Pin
Richard Andrew x6411-Dec-21 9:16
professionalRichard Andrew x6411-Dec-21 9:16 
QuestionAccess Exif Metadata Pin
Dave Dec20216-Dec-21 10:05
MemberDave Dec20216-Dec-21 10:05 
AnswerRe: Access Exif Metadata Pin
OriginalGriff6-Dec-21 10:19
mveOriginalGriff6-Dec-21 10:19 
GeneralRe: Access Exif Metadata Pin
Dave Dec20216-Dec-21 13:09
MemberDave Dec20216-Dec-21 13:09 
GeneralRe: Access Exif Metadata Pin
Luc Pattyn6-Dec-21 16:39
sitebuilderLuc Pattyn6-Dec-21 16:39 
GeneralRe: Access Exif Metadata Pin
Dave Dec20216-Dec-21 21:24
MemberDave Dec20216-Dec-21 21:24 
GeneralRe: Access Exif Metadata Pin
Dave Dec20217-Dec-21 17:02
MemberDave Dec20217-Dec-21 17:02 
GeneralRe: Access Exif Metadata Pin
Luc Pattyn7-Dec-21 17:20
sitebuilderLuc Pattyn7-Dec-21 17:20 
GeneralRe: Access Exif Metadata Pin
Dave Dec20217-Dec-21 20:51
MemberDave Dec20217-Dec-21 20:51 
GeneralRe: Access Exif Metadata Pin
Richard MacCutchan7-Dec-21 22:13
mveRichard MacCutchan7-Dec-21 22:13 
GeneralRe: Access Exif Metadata Pin
Richard Deeming7-Dec-21 22:17
mveRichard Deeming7-Dec-21 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.