public static String buildScope(String[] scopes){
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < scopes.length; i++) {
    builder.append(scopes[i]);
    if (i < scopes.length - 1) {
      builder.append(',');
    }
  }
  return builder.toString();
}

public static String buildScope ( String [ ] scopes ) { StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < scopes . length ; i ++ ) { builder . append ( scopes [ i ] ) ; if ( i < scopes . length - 1 ) { builder . append ( ',' ) ; } } return builder . toString ( ) ; }
build a scope string from an array of scopes
