Create a string constant.
(String s)
| 2160 | * Create a string constant. |
| 2161 | */ |
| 2162 | public SeqExpr<CharSort> mkString(String s) |
| 2163 | { |
| 2164 | StringBuilder buf = new StringBuilder(); |
| 2165 | for (int i = 0; i < s.length(); i += Character.charCount(s.codePointAt(i))) { |
| 2166 | int code = s.codePointAt(i); |
| 2167 | if (code <= 32 || 127 < code) |
| 2168 | buf.append(String.format("\\u{%x}", code)); |
| 2169 | else |
| 2170 | buf.append(s.charAt(i)); |
| 2171 | } |
| 2172 | return (SeqExpr<CharSort>) Expr.create(this, Native.mkString(nCtx(), buf.toString())); |
| 2173 | } |
| 2174 | |
| 2175 | /** |
| 2176 | * Convert an integer expression to a string. |