/*** @groupdef stdlib.string String operations These functions implement operations on strings. */ /** @group stdlib.string Convert \a x into a string */ function string: show(var opt set of $T: x); /** @group stdlib.string Convert \a x into a string */ function string: show(var opt $T: x); /** @group stdlib.string Convert \a x into a string */ function string: show(array[$U] of var opt $T: x); function string: showDzn(var opt set of $T: x); function string: showDzn(var opt $T: x); function string: showDzn(array[$U] of var opt $T: x); function string: showDznId(string: x); function string: showCheckerOutput(); /** @group stdlib.string Formatted to-string conversion for integers Converts the integer \a x into a string right justified by the number of characters given by \a w, or left justified if \a w is negative. */ function string: show_int(int: w, var int: x); /** @group stdlib.string Formatted to-string conversion for floats. Converts the float \a x into a string right justified by the number of characters given by \a w, or left justified if \a w is negative. The number of digits to appear after the decimal point is given by \a p. It is a run-time error for \a p to be negative. */ function string: show_float(int: w, int: p, var float: x); /** @group stdlib.string Convert two-dimensional array \a x into a string */ function string: show2d(array[int,int] of var opt $T: x) = let { int: rows=card(index_set_1of2(x)); int: cols=card(index_set_2of2(x)); array[int] of string: s = [show(x[i,j]) | i in index_set_1of2(x), j in index_set_2of2(x)]; int: max_length = max([string_length(s[i]) | i in index_set(s)]) } in "[| "++ concat([format_justify_string(max_length,s[(i-1)*cols+j])++ if j