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

8
LINES

< > BotCompany Repo | #1015734 - humanizeFormLabel - e.g. "snippetID" -> "Snippet ID"

JavaX fragment (include)

1  
static Map<S> humanizeFormLabel_replacements = litmap("id" := "ID", "md5" := "MD5");
2  
3  
sS humanizeFormLabel(S s) {
4  
  if (containsSpace(s)) ret s;
5  
  ret firstToUpper(
6  
    joinWithSpace(replaceElementsUsingMap(splitCamelCase(s), humanizeFormLabel_replacements)).replace("I D", "ID")
7  
  );
8  
}

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1015734
Snippet name: humanizeFormLabel - e.g. "snippetID" -> "Snippet ID"
Eternal ID of this version: #1015734/6
Text MD5: 626bb76cd89c63c7e6982722fc7c7c56
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-08 12:00:15
Source code size: 293 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 134 / 164
Version history: 5 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1015734 & http://1015734.tinybrain.de