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

6
LINES

< > TinyBrain | #1013628 - countLeadingSpaces - also tabs

JavaX fragment (include)

static int countLeadingSpaces(String s) {
  int i = 0;
  while (i < s.length() && (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   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1013628
Snippet name: countLeadingSpaces - also tabs
Eternal ID of this version: #1013628/3
Text MD5: 3a18c35c8c7df1339c6eef4197efeff4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-12 09:40:46
Source code size: 151 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 6 / 8
Version history: 2 change(s)
Referenced in: [show]