0

i have url string in flutter like this,

"https://qa-mamama.com/1.1/login"

how can i make my url to like this ?

"https:\/\/qa-mamama.com\/1.1\/login"

Before, i try encode to handle this, but not working any help?

1 Answer 1

1

You can do with 'replaceAll' method.

void main() {
  String a = "https://qa-mamama.com/1.1/login";
  
  String b = a.replaceAll('/', '\\/');
  print(a);
  print(b);
}

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.