Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:44:51+00:00 2026-06-01T21:44:51+00:00

var baseUri = new Uri(http://localhost/); var uri1 = new Uri(baseUri, 1); var uri2 =

  • 0
var baseUri = new Uri("http://localhost/");
var uri1 = new Uri(baseUri, "1");
var uri2 = new Uri(uri1, "2");   

Unexpectedly, uri2 is http://localhost/2. How would I append to uri1 so it’s http://localhost/1/2 intead? Does Uri do this, or do I need to fallback to strings? Incidentally, I’ve tried adding leading/trailing slashes almost everywhere.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:44:52+00:00Added an answer on June 1, 2026 at 9:44 pm

    “1” and “2” are “file name portion” of a url. If you make “1” to look more like directory path it will work ok “1/”:

    var baseUri = new Uri("http://localhost/");
    var uri1 = new Uri(baseUri, "1/");
    var uri2 = new Uri(uri1, "2"); 
    

    Note: “file name portion” is not a real term, as Url only have “path” and “query” component, but normally last chunk of a path is treated as file name: “/foo/bar/file.txt”.

    When you combine 2 path you want to replace some tail portion of the first path with the second one. In your case it ends up to have just “file name” segment for both :”/1″ and “2” (if you put real value like “/myFile.txt” and “NewFile.txt” in combining it would be easier to see why it behaves this way).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an URL like this: http://site.com/images/961b7d0e50f0462a8828d31bf0874a71/lightbox I need to string.format replace the GUID
var query1 = urlencode($('input[name=searchTerm]').val()); //user1 $.getJSON('http://twitter.com/friends/ids.json?screen_name='+ query1 +'&jsoncallback=?', function(data){ $('content').append(''+data.length+''); }); This is a
var UI$Contract$ddlForm_change = function() { //'this' is currently the drop down that fires the
I've got a chunk of code that looks like this: var task = Task.Factory.StartNew(()
I've got a chunk of code that looks like this: var task = Task.Factory.StartNew(()
When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build
Has anyone already used Flot in Android? I've been reading this http://rapidandroid.org/wiki/Graphing and i've
I need an html helper that would take care of tabs functionality on a
<script type=text/javascript src=<?php echo $this->baseurl; ?>/templates/mytemplate/javascript/min.js></script> <script type=text/javascript> var mooTrans= Fx.Transitions.<?php echo $this->params->get('transition','Sine.easeOut') ?>;
I'm banging over the wall with this... I need to establish a zend framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.