Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > TinyBrain | #1009199 - extractYouTubeID - accepts video ID or youtube URL

JavaX fragment (include)

static S extractYouTubeID(S s) {
  if (empty(s)) null;
  int i = indexOfAfter(s, "youtu.be/");
  if (i >= 0)
    ret substring(s, i);
  ret s;
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1009199
Snippet name: extractYouTubeID - accepts video ID or youtube URL
Eternal ID of this version: #1009199/2
Text MD5: ee0fd733bbfe6190e9d1c6aacaf59b17
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-15 23:20:07
Source code size: 150 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 21 / 34
Version history: 1 change(s)
Referenced in: [show]