TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to String If Youtube url Youtube Video Show
Ashish Srivastava
Apr 26
2016
Code
838
0
3
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
String strcont =
" hello "
string
pattern = @
"(?:https?:\/\/)?(?:www\.)?(?:(?:(?:youtube.com\/watch\?[^?]*v=|youtu.be\/)([\w\-]+))(?:[^\s?]+)?)"
;
string
replacement =
"<iframe title='"
+ strTitle +
"' width='560' height='315' src='https://www.youtube.com/embed/$1' frameborder='0' allowfullscreen='1'></iframe>"
;
var rgx =
new
Regex(pattern);
strcont = rgx.Replace(strcont, replacement);
How to String If youtube url youtube video Show