Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
change the character that separates a url (Angular)

I am obtaining the url with route.queryParams.subscribe and to separate the parameters I do it with Object.keys(params) where the latter separates them when it finds the "&". My question is, can I modify that separator, where I separate it when I find the character "$" for example and not the "&"?

The short code:

this.route.queryParams.subscribe(params => {
      this.keys = Object.keys(params);

}
Example this url www.hi.com?v%2BRSC60dbdNliPmWIS8mbw%3D%3D=&uHW0Oj81Fug5ifNoPI4rGSpH5uaejSqrADBFSQhRU4fKQF3oIAXWRqtpv3TNsi3c7GDgva1P%2FozKCMFkd%2FDQEKqM1DBhmnV05psQ1n913EM5NjRNK53sEo60YxgVGky1bV%2BPB2C%2F1cG44b%2FrQPNmns7jWgQmWopQvO%2FCzWCD8o12HNQoINRzi%2FWsg9OUhoNncPl%2BU8OsJWUbKutTpW%2FiLHa4IQRvlSG59iyj6HVC2hwXwZnXVXGfDDTX3bP4Am4HQlO61CsaidcoF6mEVGSpLg%3D%3D=

when you go through the code above it looks like this, where "&" is the separator

0 : v%2BRSC60dbdNliPmWIS8mbw%3D%3D=

&

1: uHW0Oj81Fug5ifNoPI4rGSpH5uaejSqrADBFSQhRU4fKQF3oIAXWRqtpv3TNsi3c7GDgva1P%2FozKCMFkd%2FDQEKqM1DBhmnV05psQ1n913EM5NjRNK53sEo60YxgVGky1bV%2BPB2C%2F1cG44b%2FrQPNmns7jWgQmWopQvO%2FCzWCD8o12HNQoINRzi%2FWsg9OUhoNncPl%2BU8OsJWUbKutTpW%2FiLHa4IQRvlSG59iyj6HVC2hwXwZnXVXGfDDTX3bP4Am4HQlO61CsaidcoF6mEVGSpLg%3D%3D=

So, I want to know if there is a way to modify the separator character, for example instead of "&" they pass me the url with the character "$" for example and that I separate it in the same way.

This is Angular

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Just in case it is useful for you, you can use this:

in the imports

import { ActivatedRoute } from '@angular/router';

in your code

const id = Number(this.activatedRoute.snapshot.paramMap.get("id"));

lets suppouse your route is this one: http://localhost:4200/identification/:id

about 4 years ago · Juan Pablo Isaza Report

0

Why not use simple do:

string.split("any character you want")

It will return list of array of the string splitted at "any character you want". Or find the index using:

string.indexOf("any character you want")

Then splice the string accoordingly. You can even loop the string and return the index using array.forEach and splice it at that position.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!