How do I avoid % in String.Format?

Asked 1 years ago, Updated 1 years ago, 84 views

I put a SQL query statement in the string.xml file, but I want to write this code in String.Format.

SELECT Field1, Field2 FROM mytable WHERE Field1 LIKE '%something%' If you have a statement like this, I know that if you want this SQL statement to run as a string here, you'll see a single quote \', but I don't know how to mark the %s.

syntax android java

2022-09-22 14:15

1 Answers

Mark % as %%.


2022-09-22 14:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.