Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to String If Youtube url Youtube Video Show
WhatsApp
Ashish Srivastava
Apr 26
2016
880
0
3
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
Up Next
How to String If Youtube url Youtube Video Show