org.pentaho.di.core.Const.splitString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.pentaho.di.core.Const.splitString()方法的一些代码示例,展示了Const.splitString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.splitString()方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:splitString

Const.splitString介绍

[英]Convert strings separated by a character into an array of strings.

Example: a;b;c;d == new String[] { a, b, c, d }
[中]将由字符分隔的字符串转换为字符串数组。
Example: a;b;c;d == new String[] { a, b, c, d }

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Convert strings separated by a character into an array of strings.
 * <p>
 * <code>
 Example: a;b;c;d    ==  new String[] { a, b, c, d }
 * </code>
 *
 * @param string
 *          The string to split
 * @param separator
 *          The separator used.
 * @return the string split into an array of strings
 */
public static String[] splitString( String string, char separator ) {
 return splitString( string, separator, false );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Split the given string using the given delimiter and enclosure strings.
 *
 * The delimiter and enclosures are not regular expressions (regexes); rather they are literal strings that will be
 * quoted so as not to be treated like regexes.
 *
 * This method expects that the data contains an even number of enclosure strings in the input; otherwise the results
 * are undefined
 *
 * @param stringToSplit
 *          the String to split
 * @param delimiter
 *          the delimiter string
 * @param enclosure
 *          the enclosure string
 * @return an array of strings split on the delimiter (ignoring those in enclosures), or null if the string to split
 *         is null.
 */
public static String[] splitString( String stringToSplit, String delimiter, String enclosure ) {
 return splitString( stringToSplit, delimiter, enclosure, false );
}

代码示例来源:origin: pentaho/pentaho-kettle

inList = Const.splitString( fieldMeta2.getString( field2 ), ';', true );
for ( int i = 0; i < inList.length; i++ ) {
 inList[i] = inList[i] == null ? null : inList[i].replace( "\\", "" );

代码示例来源:origin: pentaho/pentaho-kettle

String[] valueParts = Const.splitString( valueToSplit, data.delimiter, data.enclosure, removeEnclosure );
int prev = 0;
for ( int i = 0; i < meta.getFieldsCount(); i++ ) {

代码示例来源:origin: pentaho/pentaho-kettle

String[] fieldNames = Const.splitString( line, meta.getDelimiter() );

代码示例来源:origin: pentaho/pentaho-kettle

String[] fieldNames = Const.splitString( line, meta.getDelimiter() );

相关文章

微信公众号

最新文章

更多