Although you haven't told us what the rule is for calculating the result you're after, it looks like you need to check the day-of-month and add one if the end one is the same or later:
using System;
using System.Globalization;
using System.Linq;
namespace ConsoleApp1
{
class Program
{
class DatePair
{
public DateTime Start { get; set; }
public DateTime End { get; set; }
public DatePair(string s)
{
var ci = new CultureInfo("en-US");
var parts = s.Split(",".ToCharArray());
this.Start = DateTime.Parse(parts[0], ci);
this.End = DateTime.Parse(parts[1], ci);
}
}
static void Main(string[] args)
{
string dats = "08/28/2019,09/02/2019;06/01/2019,09/02/2019;01/02/2019,03/02/2019;01/02/2019,03/05/2019";
var dates = dats.Split(";".ToCharArray()).Select(p => new DatePair(p));
foreach (DatePair d in dates)
{
var x = d.End.Month - d.Start.Month;
if (d.End.Day >= d.Start.Day) { x += 1; }
Console.WriteLine(d.Start.ToString("yyyy-MM-dd") + " " + d.End.ToString("yyyy-MM-dd") + " " + x.ToString());
}
Console.ReadLine();
}
}
}
Outputs:
2019-08-28 2019-09-02 1
2019-06-01 2019-09-02 4
2019-01-02 2019-03-02 3
2019-01-02 2019-03-05 3
I did not include the years in the calculation as there was no example date for that.