Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
VoiceBot
WallpaperFusion
▼
Download
Download
Change Log
License (EULA)
▼
Features
Features
HotKeys
Macros
Triggers
Clipboard Syncing
Clipboard Manager
Languages
Free vs Pro
Purchase
Screenshots
Apps
▼
Online
Online
Recent Items
Pinned Items
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Macros
Languages
Clipboard
Fusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Shorten YouTube Link
Return to ClipboardFusion Macros
Description
This macro shortens a YouTube video from the full https://www.youtube.com/watch?v= to the youtu.be version.
Language
C# (.Net)
Minimum Version
4.2+
Created By
Joshua T
Contributors
-
Date Created
Jan 4, 2017
Date Last Modified
Jan 4, 2017
Macro Code
Copy
Select All
using System; using System.Text.RegularExpressions; public static class ClipboardFusionHelper { public static string ProcessText(string text) { Regex youtubeRegex = new Regex(@"https://www\.youtube\.com\/watch\?v\=(?<id>[^\&]*)(?:\&.*)?"); Match match = youtubeRegex.Match(text); if (!match.Success) { // If this isn't a YouTube video, don't do anything to it return text; } Group idGroup = match.Groups["id"]; string idText = idGroup.Value; return "https://youtu.be/" + idText; } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get Binary Fortress Merch