public static void Main()
string x = "|Hello World";
Console.WriteLine(GetDrawingAnnotationThickness(x)?.ToString() ?? "NULL");
SetDrawingAnnotationThickness(ref x, 5);
private static double? GetDrawingAnnotationThickness(string annotationPoints)
if (!string.IsNullOrEmpty(annotationPoints))
string annotationThickness = annotationPoints.Substring(0, annotationPoints.IndexOf('|'));
if (string.IsNullOrEmpty(annotationThickness))
return Convert.ToInt64(annotationThickness);
private static void SetDrawingAnnotationThickness(ref string annotationPoints, double? annotationDrawingThickness)
if (annotationDrawingThickness != null && !string.IsNullOrEmpty(annotationPoints))
int annotationThicknessMarkIndex = annotationPoints.IndexOf('|');
if (annotationThicknessMarkIndex > 0)
annotationPoints = annotationPoints.Remove(0, annotationThicknessMarkIndex + 1);
annotationPoints = annotationDrawingThickness.ToString() + "|" + annotationPoints;