本文整理汇总了C#中System.String.StartsWith方法的典型用法代码示例。如果您正苦于以下问题:C# System.String.StartsWith方法的具体用法?C# System.String.StartsWith怎么用?C# System.String.StartsWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.String
的用法示例。
在下文中一共展示了System.String.StartsWith方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: nextVASPToken
/// <summary> Find the next token of an VASP file.
/// ABINIT tokens are words separated by space(s). Characters
/// following a "#" are ignored till the end of the line.
///
/// </summary>
/// <returns> a <code>String</code> value
/// </returns>
/// <exception cref="IOException">if an error occurs
/// </exception>
public virtual System.String nextVASPToken(bool newLine)
{
System.String line;
if (newLine)
{
// We ignore the end of the line and go to the following line
if (inputBuffer.Peek() != -1)
{
line = inputBuffer.ReadLine();
st = new SupportClass.Tokenizer(line, " =\t");
}
}
while (!st.HasMoreTokens() && inputBuffer.Peek() != -1)
{
line = inputBuffer.ReadLine();
st = new SupportClass.Tokenizer(line, " =\t");
}
if (st.HasMoreTokens())
{
fieldVal = st.NextToken();
if (fieldVal.StartsWith("#"))
{
nextVASPToken(true);
}
}
else
{
fieldVal = null;
}
return this.fieldVal;
} //end nextVASPToken(boolean newLine)