/save location leerzeichen

This commit is contained in:
hydrant
2019-10-04 19:03:53 +02:00
parent d61a9bcdb8
commit 1a80237ff6
2 changed files with 7 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -31,7 +32,10 @@ namespace ReallifeGamemode.DataService.Controllers
foreach(var location in list)
{
locations.Add($"{Uri.EscapeDataString(location.Description).PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)} - Richtung: {Math.Round(location.Heading, 2)}");
string description = location.Description;
description = Regex.Replace(description, @"<[^>]*(>|$)", string.Empty);
description = Regex.Replace(description, @"[\s\r\n]+", " ").Trim();
locations.Add($"{description.PadRight(20)} - {Math.Round(location.X, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Y, 2).ToString(CultureInfo.InvariantCulture)}, {Math.Round(location.Z, 2).ToString(CultureInfo.InvariantCulture)} - Richtung: {Math.Round(location.Heading, 2)}");
}
return locations;