Q
Q
qwex2016-07-14 21:55:39
go
qwex, 2016-07-14 21:55:39

How to parse a link?

Hello.
I receive a link from the user in the following format:
domain.ru/profile/id/?login=lol&pal=156654
I need to parse this domain and get
login=lol pal
=156654
and validate for
domain.ru/profile/id/
please how can this be done.
I will be very grateful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
fastpars, 2016-07-14
@valerafedorchenko

Hello. The net/url
package has a Parse function . Use it. Keep an example: https://play.golang.org/p/qpUvsVQ5XD

#
#algooptimize #bottize, 2016-07-14
@user004

If directly, then
Google
index string split
Not
directly url.parse.query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question