Tabnine Logo
StringUtil2.splitString
Code IndexAdd Tabnine to your IDE (free)

How to use
splitString
method
in
ucar.unidata.util.StringUtil2

Best Java code snippets using ucar.unidata.util.StringUtil2.splitString (Showing top 20 results out of 315)

origin: Unidata/thredds

public CoverageCoordAxisBuilder setDependsOn(String dependsOn) {
 if (dependsOn != null && dependsOn.trim().length() > 0) {
  List<String> temp = new ArrayList<>();
  Collections.addAll(temp, StringUtil2.splitString(dependsOn));
  this.dependsOn = Collections.unmodifiableList(temp);
 } else {
  this.dependsOn = Collections.emptyList();
 }
 return this;
}
origin: edu.ucar/netcdf

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(FmrcDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   FmrcDatasetType fdt = FmrcDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize FmrcDatasetType " + type);
  }
 }
}
origin: edu.ucar/netcdf

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(PointDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   PointDatasetType fdt = PointDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize PointDatasetType " + type);
  }
 }
}
origin: Unidata/thredds

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(FmrcDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   FmrcDatasetType fdt = FmrcDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize FmrcDatasetType " + type);
  }
 }
}
origin: Unidata/thredds

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(PointDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   PointDatasetType fdt = PointDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize PointDatasetType " + type);
  }
 }
}
origin: edu.ucar/netcdf

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicitDatasets) datasets = EnumSet.noneOf(GribDatasetType.class);
 explicitDatasets = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   GribDatasetType fdt = GribDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize GribDatasetType {}", type);
  }
 }
}
origin: edu.ucar/cdm

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(FmrcDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   FmrcDatasetType fdt = FmrcDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize FmrcDatasetType " + type);
  }
 }
}
origin: edu.ucar/cdm

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicit) datasets = EnumSet.noneOf(PointDatasetType.class);
 explicit = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   PointDatasetType fdt = PointDatasetType.valueOf(type);
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize PointDatasetType " + type);
  }
 }
}
origin: edu.ucar/cdm

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicitDatasets) datasets = EnumSet.noneOf(GribDatasetType.class);
 explicitDatasets = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   GribDatasetType fdt = GribDatasetType.valueOf(type);
   if (fdt == GribDatasetType.LatestFile) fdt = GribDatasetType.Latest;
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize GribDatasetType {}", type);
  }
 }
}
origin: Unidata/thredds

public void addDatasetType(String datasetTypes) {
 // if they list datasetType explicitly, remove defaults
 if (!explicitDatasets) datasets = EnumSet.noneOf(GribDatasetType.class);
 explicitDatasets = true;
 String[] types = StringUtil2.splitString(datasetTypes);
 for (String type : types) {
  try {
   GribDatasetType fdt = GribDatasetType.valueOf(type);
   if (fdt == GribDatasetType.LatestFile) fdt = GribDatasetType.Latest;
   datasets.add(fdt);
  } catch (Exception e) {
   log.warn("Dont recognize GribDatasetType {}", type);
  }
 }
}
origin: edu.ucar/cdm

int sepLength = sep.length();
switch (sepLength) {
  case 0:  String[] tokens = splitString(fullString);   // default to use white space if separator is ""
       strs = Arrays.asList(tokens);
       break;
String[] tokens = splitString(fullString);
strs = Arrays.asList(tokens);
origin: Unidata/thredds

switch (sepLength) {
 case 0:
  String[] tokens = splitString(fullString);   // default to use white space if separator is ""
  strs = Arrays.asList(tokens);
  break;
String[] tokens = splitString(fullString);
strs = Arrays.asList(tokens);
origin: edu.ucar/netcdf

/**
 * Convert a udunit period string into a CalendarPeriod
 * @param udunit period string
 * @return CalendarPeriod  or null if illegal
 */
public static CalendarPeriod of(String udunit) {
 String[] split = StringUtil2.splitString(udunit);
 if (split.length != 2) return null;
 try {
  int value = Integer.parseInt(split[0]);
  CalendarPeriod.Field unit = CalendarPeriod.fromUnitString(split[1]);
  return CalendarPeriod.of(value, unit);
 } catch (Throwable t) {
  return null;
 }
}
origin: Unidata/thredds

if (line == null) break;
if ((line.length() == 0) || line.startsWith("#")) continue;
String[] flds = StringUtil2.splitString(line);
origin: edu.ucar/cdm

/**
 * Convert a udunit period string into a CalendarPeriod
 * @param udunit period string : "[val] unit"
 * @return CalendarPeriod or null if illegal
 */
public static CalendarPeriod of(String udunit) {
 int value;
 String units;
 String[] split = StringUtil2.splitString(udunit);
 if (split.length == 1) {
  value = 1;
  units =  split[0];
 } else if (split.length == 2) {
  try {
   value = Integer.parseInt(split[0]);
  } catch (Throwable t) {
   return null;
  }
  units =  split[1];
 } else
  return null;
 CalendarPeriod.Field unit = CalendarPeriod.fromUnitString(units);
 return CalendarPeriod.of(value, unit);
}
origin: Unidata/thredds

/**
 * Convert a udunit period string into a CalendarPeriod
 * @param udunit period string : "[val] unit"
 * @return CalendarPeriod or null if illegal
 */
public static CalendarPeriod of(String udunit) {
 int value;
 String units;
 String[] split = StringUtil2.splitString(udunit);
 if (split.length == 1) {
  value = 1;
  units =  split[0];
 } else if (split.length == 2) {
  try {
   value = Integer.parseInt(split[0]);
  } catch (Throwable t) {
   return null;
  }
  units =  split[1];
 } else
  return null;
 CalendarPeriod.Field unit = CalendarPeriod.fromUnitString(units);
 return CalendarPeriod.of(value, unit);
}
origin: Unidata/thredds

if (line != null) {
 line = StringUtil2.remove(line, '*');
 String[] split = StringUtil2.splitString(line);
 scale = Integer.parseInt(split[0].trim());
 refVal = Integer.parseInt(split[1].trim());
origin: Unidata/thredds

String[] flds = StringUtil2.splitString(line);
int fxy = Integer.parseInt(flds[0]);
int y = fxy % 1000;
String[] flds = StringUtil2.splitString(line);
String fxys = cleanNumber(flds[0]);
int fxy = Integer.parseInt(fxys);
origin: edu.ucar/netcdf

String[] tokens = StringUtil2.splitString(values);
List<String> valList = Arrays.asList(tokens);
v.setValues(valList);
origin: edu.ucar/cdm

 return;
String[] dims = StringUtil2.splitString(dimName);
List<Dimension> dimList = new ArrayList<>();
for (String s : dims) {
ucar.unidata.utilStringUtil2splitString

Javadoc

Split a string on one or more whitespace. Cover for String.split, because who can remember regexp?

Popular methods of StringUtil2

  • replace
    Replace any of the characters from out with corresponding character from in
  • remove
    Remove any of the characters in out from sb
  • substitute
    Find all occurences of the "match" in original, and substitute the "subst" string, directly into the
  • cleanup
    Delete any non-printable characters
  • unescape
    This finds any '%xx' and converts to the equivalent char. Inverse of escape().
  • collapseWhitespace
    Collapse continuous whitespace into one single " ".
  • allow
    Replace any char not alphanumeric or in allowChars by replaceChar.
  • breakTextAtWords
    Break the given text into lines, respecting word boundaries (blank space).
  • escape
    Escape any char not alphanumeric or in okChars. Escape by replacing char with %xx (hex).
  • getTokens
  • makeValidCdmObjectName
  • padLeft
    Pad the given string with padString on the left up to the given length.
  • makeValidCdmObjectName,
  • padLeft,
  • padRight,
  • quoteHtmlContent,
  • unreplace,
  • filter7bits,
  • match,
  • quoteXmlAttribute,
  • removeFromEnd

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JPanel (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now