Hello everyone I’m trying to remove some characters in my text box
For example
In my textbox, user fill with this text as you can see at below
http://youtu.be/YBkPomr40pg
I want to remove these characters http://youtu.be/
So how can I do could you show me an example ?
Load the URL into a Uri and get the relative URL from it. http://msdn.microsoft.com/en-us/library/system.uri.aspx
See this question for how to get the relative URL: Getting the relative uri from the absolute uri
Note that you will get the URL with the starting /. You can trim that yoruself.
If you’re saying that you are ONLY going to be getting youtube URLs and you want simply the youtube video ID, this same technique can work, but you mgiht be better off just using string split to split on ‘/’ and getting the last item.