It looks like the issue is that theNumber is not being correctly inserted into the URL, and instead, the number is being encoded as [%223%22] (which represents 3 in URL encoding). To properly replace the value in the URL with the complete theNumber, you should ensure that the number is not encoded during the replacement process.
Here’s the approach to replace the string "NewNumber" with the actual number 32056489:
Dim inputURL As String = "https:/cfb790-2ad9-550b-bb0d-4e9cc5456758/sr/?objectdefinitionids=[%22DSDAU%22]&properties={%22333%22%3A[%22Number%22]%2C%2228%22%3A[%22NewNumber%22]%2C%22property_remark%22%3A[%22PDF%2FAZSDODEL*%22]}&propertysort=property_creation_date&ascending=false&showdetails=false"
Dim theNumber As String = "32056489"
' Perform the replacement
Dim UpdatedURL As String = System.Text.RegularExpressions.Regex.Replace(inputURL, "NewNumber", theNumber)
Console.WriteLine(UpdatedURL)
Explanation:
Regex.Replace: The expression System.Text.RegularExpressions.Regex.Replace(inputURL, "NewNumber", theNumber) will search for the exact string "NewNumber" and replace it with the value of theNumber ("32056489" in this case).
Ensure theNumber is a string: If theNumber is already a number, you may want to convert it to a string before replacing, like so:
Dim theNumber As String = 32056489.ToString()
With this approach, the URL will properly be updated to: