Answer the question
In order to leave comments, you need to log in
How to clean a string from extra characters?
Greetings,
For example, there is a link line:
https://vk.com/wall-307584833_1982089?reply=3438479
How can I extract the numbers from this link that come after wall,
that is, 307584833
and after reply= (3438479)
And place them in long variables?
Never encountered parsing :(
I hope for your help, thanks!
Answer the question
In order to leave comments, you need to log in
Match match = Regex.Match("https://vk.com/wall-307584833_1982089?reply=3438479", @"wall\-(\d+)_\d+\?reply\=(\d+)",
RegexOptions.IgnoreCase);
if (match.Success)
{
string wallId= match.Groups[1].Value;
string replyId= match.Groups[2].Value;
}
https://stackoverflow.com/questions/15713542/elega...
Uri myUri = new Uri("https://vk.com/wall-307584833_1982089?reply=3438479");
long reply_id = (long)HttpUtility.ParseQueryString(myUri.Query).Get("reply");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question