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

6
LINES

< > BotCompany Repo | #1013628 // countLeadingSpaces - also tabs

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

Libraryless. Click here for Pure Java version (2524L/16K).

static int countLeadingSpaces(String s) {
  int i = 0, n = l(s);
  while (i < n && (s.charAt(i) == ' ' || s.charAt(i) == '\t'))
    ++i;
  ret i;
}

Author comment

Began life as a copy of #1001543

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: #1013628
Snippet name: countLeadingSpaces - also tabs
Eternal ID of this version: #1013628/4
Text MD5: 2496f9e940b040fb7c0b459e53f50715
Transpilation MD5: c78396ddc3955f2fe0dcc6f2b9ffa745
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-05 16:39:22
Source code size: 152 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 344 / 443
Version history: 3 change(s)
Referenced in: [show references]