mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
parent
0bc8518cb5
commit
6013d5da47
|
@ -2016,7 +2016,15 @@ public class Context implements AutoCloseable {
|
|||
*/
|
||||
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…
Reference in a new issue