Creates and returns a string representation of this object,
using the given separator for the fields

@param f Separator
@return A String representation of this object
969444
private String createString(String f)
    {
        StringBuilder sb = new StringBuilder();
        switch (resType)
        {
            case cudaResourceType.cudaResourceTypeArray:
                sb.append("array="+array_array+f);
                break;

            case  cudaResourceType.cudaResourceTypeMipmappedArray:
                sb.append("mipmap="+mipmap_mipmap+f);
                break;

            case  cudaResourceType.cudaResourceTypeLinear:
                sb.append("devPtr="+linear_devPtr+f);
                sb.append("format="+linear_desc+f);
                sb.append("sizeInBytes="+linear_sizeInBytes+f);
                break;

            case  cudaResourceType.cudaResourceTypePitch2D:
                sb.append("devPtr="+pitch2D_devPtr+f);
                sb.append("format="+pitch2D_desc+f);
                sb.append("width="+pitch2D_width+f);
                sb.append("height="+pitch2D_height+f);
                sb.append("pitchInBytes="+pitch2D_pitchInBytes+f);
                break;

            default:
                sb.append("INVALID");
        }
        return sb.toString();
    }
883618
public static void fieldsToString (
            StringBuilder buf, Object object, String sep)
    {
        Class<?> clazz = object.getClass();
        Field[] fields = clazz.getFields();
        int written = 0;

        // we only want non-static fields
        for (Field field : fields) {
            int mods = field.getModifiers();
            if ((mods & Modifier.PUBLIC) == 0 || (mods & Modifier.STATIC) != 0) {
                continue;
            }

            if (written > 0) {
                buf.append(sep);
            }

            // look for a toString() method for this field
            buf.append(field.getName()).append("=");
            try {
                try {
                    Method meth = clazz.getMethod(field.getName() + "ToString", new Class<?>[0]);
                    buf.append(meth.invoke(object, (Object[]) null));
                } catch (NoSuchMethodException nsme) {
                    toString(buf, field.get(object));
                }
            } catch (Exception e) {
                buf.append("<error: " + e + ">");
            }
            written++;
        }
    }
384531
function (f) {
			var fmt = f || this.format
			, sepchar = getSeparator(fmt)
			, local = this;

			return _.map((fmt || 'yyyy mm dd').split(sepchar), function(part) {
				return local.template()[part];
			});
		}
598714
public String toMutilLineString() {
		final String newLine = System.getProperty("line.separator");
		final StringBuffer problemStr = new StringBuffer();
		for (final Problem problem : this.problems) {
			problemStr.append(problem.getMessage() + newLine);
		}
		return problemStr.toString();
	}
368516
public static String buildToString(Object... params) {
		StringBuffer finalMessage = new StringBuffer();
		int i = 0;
		for (Object object : params) {
			if (i++ > 0) {
				finalMessage.append(FIELD_SEPARATOR);
			}
			if (object instanceof List<?>) {
				finalMessage.append(JKCollectionUtil.toString((List<?>) object));
			} else {
				finalMessage.append(JKObjectUtil.toString(object, true));
			}
		}
		String fullText = finalMessage.toString();
		return fullText;
	}
390320
private String createString(String f)
    {
        return
            "function="+function+f+
            "gridDimX="+gridDimX+f+
            "gridDimY="+gridDimY+f+
            "gridDimZ="+gridDimZ+f+
            "blockDimX="+blockDimX+f+
            "blockDimY="+blockDimY+f+
            "blockDimZ="+blockDimZ+f+
            "sharedMemBytes="+sharedMemBytes+f+
            "hStream="+hStream+f+
            "kernelParams="+kernelParams;
    }
1128503
public static <E> String listAsString(List<E> list, String separator) {

        StringBuffer string = new StringBuffer(128);
        Iterator<E> it = list.iterator();
        while (it.hasNext()) {
            string.append(it.next());
            if (it.hasNext()) {
                string.append(separator);
            }
        }
        return string.toString();
    }
485578
public String generate (String fsection, String msection)
        throws IOException
    {
        StringWriter writer = new StringWriter();
        BufferedWriter bout = new BufferedWriter(writer);
        addOrRemoveGeneratedImport(StringUtil.deNull(fsection).contains("@Generated(") ||
            StringUtil.deNull(msection).contains("@Generated("));

        // write the preamble
        for (int ii = 0; ii < _nstart; ii++) {
            writeln(bout, _lines.get(ii));
        }

        // write the field section
        if (!StringUtil.isBlank(fsection)) {
            String prev = safeGetLine(_nstart-1);
            if (!StringUtil.isBlank(prev) && !prev.equals("{")) {
                bout.newLine();
            }
            writeln(bout, "    " + FIELDS_START);
            bout.write(fsection);
            writeln(bout, "    " + FIELDS_END);
            if (!StringUtil.isBlank(safeGetLine(_nend))) {
                bout.newLine();
            }
        }

        // write the mid-amble
        for (int ii = _nend; ii < _mstart; ii++) {
            writeln(bout, _lines.get(ii));
        }

        // write the method section
        if (!StringUtil.isBlank(msection)) {
            if (!StringUtil.isBlank(safeGetLine(_mstart-1))) {
                bout.newLine();
            }
            writeln(bout, "    " + METHODS_START);
            bout.write(msection);
            writeln(bout, "    " + METHODS_END);
            String next = safeGetLine(_mend);
            if (!StringUtil.isBlank(next) && !next.equals("}")) {
                bout.newLine();
            }
        }

        // write the postamble
        for (int ii = _mend, nn = _lines.size(); ii < nn; ii++) {
            writeln(bout, _lines.get(ii));
        }
        bout.close();
        return writer.toString();
    }
1042843
@Nonnull
    public static String join(@Nonnull Collection<?> strings, @Nonnull String separator) {
        StringBuilder buf = new StringBuilder();
        boolean first=true;
        for (Object s : strings) {
            if(first)   first=false;
            else        buf.append(separator);
            buf.append(s);
        }
        return buf.toString();
    }
473805
public static String join(final Collection<String> list, final String separator) {
        final StringBuilder sb = new StringBuilder();
        for (final String s : list) {
            if (sb.length() > 0) {
                sb.append(separator);
            }
            sb.append(s);
        }
        return sb.toString();
    }
790704
public static StringBuilder formatTo(StringBuilder buf, double[] d, String sep) {
    if(d == null) {
      return buf.append("null");
    }
    if(d.length == 0) {
      return buf;
    }
    buf.append(d[0]);
    for(int i = 1; i < d.length; i++) {
      buf.append(sep).append(d[i]);
    }
    return buf;
  }
379312
public static String collectionAsString(Collection<?> collection, String separator) {

        StringBuffer string = new StringBuffer(128);
        Iterator<?> it = collection.iterator();
        while (it.hasNext()) {
            string.append(it.next());
            if (it.hasNext()) {
                string.append(separator);
            }
        }
        return string.toString();
    }
1088729
public String[] getStringArrayBySeparator(String key, String separator) {
    String value = getString(key);
    if (value != null) {
      String[] strings = StringUtils.splitByWholeSeparator(value, separator);
      String[] result = new String[strings.length];
      for (int index = 0; index < strings.length; index++) {
        result[index] = trim(strings[index]);
      }
      return result;
    }
    return ArrayUtils.EMPTY_STRING_ARRAY;
  }
1081322
private Object getField(Object object, Field f) {
        f.setAccessible(true);
        try {
            return f.get(object);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
86076
public static String readFileToString(File f) throws IOException {
		StringWriter sw = new StringWriter();
		IO.copyAndCloseBoth(Common.asReaderUTF8Lenient(new FileInputStream(f)), sw);
		return sw.toString();
	}
1175579
public static String join(String[] strings, String separator) {
      StringBuilder sb = new StringBuilder();
      boolean first = true;
      for (String s : strings) {
         if (first) {
            first = false;
         } else {
            sb.append(separator);
         }
         sb.append(s);
      }
      return sb.toString();
   }
1273716
public static List<String> readToList(File f) throws IOException {
		try (final Reader reader = asReaderUTF8Lenient(new FileInputStream(f))) {
			return readToList(reader);
		} catch (IOException ioe) {
			throw new IllegalStateException(String.format("Failed to read %s: %s", f.getAbsolutePath(), ioe), ioe);
		}
	}