mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 12:23:38 +00:00
parent
0bc8518cb5
commit
6013d5da47
1 changed files with 9 additions and 1 deletions
|
@ -2016,7 +2016,15 @@ public class Context implements AutoCloseable {
|
||||||
*/
|
*/
|
||||||
public SeqExpr<CharSort> mkString(String s)
|
public SeqExpr<CharSort> mkString(String s)
|
||||||
{
|
{
|
||||||
return (SeqExpr<CharSort>) Expr.create(this, Native.mkString(nCtx(), s));
|
StringBuilder buf = new StringBuilder();
|
||||||
|
for (int i = 0; i < s.length(); ++i) {
|
||||||
|
int code = s.codePointAt(i);
|
||||||
|
if (code <= 32 || 127 < code)
|
||||||
|
buf.append(String.format("\\u{%x}", code));
|
||||||
|
else
|
||||||
|
buf.append(s.charAt(i));
|
||||||
|
}
|
||||||
|
return (SeqExpr<CharSort>) Expr.create(this, Native.mkString(nCtx(), buf.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue