using System;
using System.Collections.Generic;

namespace Cute.Payment;

public static class StringExtensions
{
	public static string[] SubstringAtCount(this string self, int count)
	{
		List<string> list = new List<string>();
		int num = (int)Math.Ceiling((double)self.Length / (double)count);
		for (int i = 0; i < num; i++)
		{
			int num2 = count * i;
			if (self.Length <= num2)
			{
				break;
			}
			if (self.Length < num2 + count)
			{
				list.Add(self.Substring(num2));
			}
			else
			{
				list.Add(self.Substring(num2, count));
			}
		}
		return list.ToArray();
	}
}
