Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Service/Helpers/ServiceHelper.cs (C#)

Code before:
{
    public static class ServiceHelper
    {
        public static IEnumerable<Result> Search(string search, string icoPath, PluginInitContext context)
        {
            var services = ServiceController.GetServices();
            IEnumerable<ServiceController> serviceList = new List<ServiceController>();

            if (search.StartsWith(Resources.wox_plugin_service_status + ":", StringComparison.CurrentCultureIgnoreCase))
            {
                // allows queries like 'status:running'
                serviceList = services.Where(s => GetLocalizedStatus(s.Status).Contains(search.Split(':')[1], StringComparison.CurrentCultureIgnoreCase)).ToList().OrderBy(x => (int)x.Status);
            }
            else if (search.StartsWith(Resources.wox_plugin_service_startup + ":", StringComparison.CurrentCultureIgnoreCase))
            {
                // allows queries like 'startup:automatic'
                serviceList = services.Where(s => GetLocalizedStartType(s.StartType, s.ServiceName).Contains(search.Split(':')[1], StringComparison.CurrentCultureIgnoreCase)).ToList().OrderBy(x => (int)x.StartType);
            }
            else
            {
				// To show 'starts with' results first, we split the search into two steps and then concatenating the lists.
                var servicesStartsWith = services
					.Where(s => s.DisplayName.StartsWith(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.StartsWith(search, StringComparison.OrdinalIgnoreCase) || GetResultTitle(s).StartsWith(search, StringComparison.OrdinalIgnoreCase));
                var servicesContains = services.Except(servicesStartsWith)
                    .Where(s => s.DisplayName.Contains(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.Contains(search, StringComparison.OrdinalIgnoreCase) || GetResultTitle(s).Contains(search, StringComparison.OrdinalIgnoreCase));
                serviceList = servicesStartsWith.Concat(servicesContains);
            }

            return serviceList.Select(s =>
            {
                ServiceResult serviceResult = new ServiceResult(s);
                Func<ActionContext, bool> serviceAction;
                if (serviceResult.IsRunning)
                {
                    serviceAction = _ =>
                    {
                        Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Stop, context.API));
                        return true;
                    };
                }
                else
                {
                    serviceAction = _ =>
                    {
                        Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Start, context.API));
                        return true;
                    };
                }

                return new Result
                {

Review comment (suggestion):
```suggestion
                // To show 'starts with' results first, we split the search into two steps and then concatenating the lists.
                var servicesStartsWith = services
                    .Where(s => s.DisplayName.StartsWith(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.StartsWith(search, StringComparison.OrdinalIgnoreCase) || GetResultTitle(s).StartsWith(search, StringComparison.OrdinalIgnoreCase));
                var servicesContains = services.Except(servicesStartsWith)
                    .Where(s => s.DisplayName.Contains(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.Contains(search, StringComparison.OrdinalIgnoreCase) || GetResultTitle(s).Contains(search, StringComparison.OrdinalIgnoreCase));
                serviceList = servicesStartsWith.Concat(servicesContains);
```

Code after:
{
    public static class ServiceHelper
    {
        public static IEnumerable<Result> Search(string search, string icoPath, PluginInitContext context)
        {
            var services = ServiceController.GetServices().OrderBy(s => s.DisplayName);
            IEnumerable<ServiceController> serviceList = new List<ServiceController>();

            if (search.StartsWith(Resources.wox_plugin_service_status + ":", StringComparison.CurrentCultureIgnoreCase))
            {
                // allows queries like 'status:running'
                serviceList = services.Where(s => GetLocalizedStatus(s.Status).Contains(search.Split(':')[1], StringComparison.CurrentCultureIgnoreCase));
            }
            else if (search.StartsWith(Resources.wox_plugin_service_startup + ":", StringComparison.CurrentCultureIgnoreCase))
            {
                // allows queries like 'startup:automatic'
                serviceList = services.Where(s => GetLocalizedStartType(s.StartType, s.ServiceName).Contains(search.Split(':')[1], StringComparison.CurrentCultureIgnoreCase));
            }
            else
            {
                // To show 'starts with' results first, we split the search into two steps and then concatenating the lists.
                var servicesStartsWith = services
                    .Where(s => s.DisplayName.StartsWith(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.StartsWith(search, StringComparison.OrdinalIgnoreCase));
                var servicesContains = services.Except(servicesStartsWith)
                    .Where(s => s.DisplayName.Contains(search, StringComparison.OrdinalIgnoreCase) || s.ServiceName.Contains(search, StringComparison.OrdinalIgnoreCase));
                serviceList = servicesStartsWith.Concat(servicesContains);
            }

            return serviceList.Select(s =>
            {
                ServiceResult serviceResult = new ServiceResult(s);
                Func<ActionContext, bool> serviceAction;
                if (serviceResult.IsRunning)
                {
                    serviceAction = _ =>
                    {
                        Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Stop, context.API));
                        return true;
                    };
                }
                else
                {
                    serviceAction = _ =>
                    {
                        Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Start, context.API));
                        return true;
                    };
                }

                return new Result
                {