MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / length

Method length

Java/Leetcode/Leetcode58.java:9–18  ·  view source on GitHub ↗
(String str)

Source from the content-addressed store, hash-verified

7 }
8
9 static int length(String str){
10 StringBuilder s=new StringBuilder(str.trim());
11 int l=0;
12 for (int i = s.length()-1; i >=0 ; i--) {
13 if(Character.isWhitespace(s.charAt(i))){
14 return l=(s.substring(i+1).length());
15 }
16 }
17 return s.length();
18 }
19}

Callers 15

mainMethod · 0.95
ableMethod · 0.80
mainFunction · 0.80
is_plaindFunction · 0.80
funcFunction · 0.80
reverseWordsMethod · 0.80
areOccurrencesEqualMethod · 0.80
detectCapitalUseMethod · 0.80
maxDepthMethod · 0.80
numberOfBeamsMethod · 0.80
mergeAlternatelyMethod · 0.80

Calls

no outgoing calls

Tested by 3

is_plaindFunction · 0.64
funcFunction · 0.64