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

7
LINES

< > BotCompany Repo | #1007662 // firstWord2 - some variation on the theme

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3191L/18K).

sS firstWord2(S s) {
  s = xltrim(s);
  if (empty(s)) ret "";
  if (isLetterOrDigit(first(s)))
    ret takeCharsWhile isLetterOrDigit(s);
  else ret "" + first(s);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007662
Snippet name: firstWord2 - some variation on the theme
Eternal ID of this version: #1007662/4
Text MD5: dfbb23604e58baca0b984564e547a7ab
Transpilation MD5: ccd7bbd026f776246de210a1e5b664ff
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-27 08:37:46
Source code size: 171 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 486 / 501
Version history: 3 change(s)
Referenced in: [show references]