StringElementImpl extends PyTree implements StringElement { @Override public boolean isInterpolated() { String prefix = prefix(); return prefix.indexOf('f') >= 0 || prefix.indexOf('F') >= 0; } StringElementImpl(Token token); @Override Token firstToken(); @Override Token lastToken(); @Override Kind getKind(); @Override void accept(TreeVisitor visitor); @Override List<Tree> computeChildren(); @Override String value(); @Override String trimmedQuotesValue(); @Override String prefix(); @Override boolean isTripleQuoted(); @Override boolean isInterpolated(); @Override List<Expression> interpolatedExpressions(); @Override List<FormattedExpression> formattedExpressions(); int contentStartIndex();  }
@Test public void isInterpolated() { assertThat(stringElement("'abc'").isInterpolated()).isFalse(); assertThat(stringElement("f'abc'").isInterpolated()).isTrue(); assertThat(stringElement("F'abc'").isInterpolated()).isTrue(); assertThat(stringElement("r'abc'").isInterpolated()).isFalse(); assertThat(stringElement("rf'abc'").isInterpolated()).isTrue(); }