First, String.IndexOf
String.IndexOf method (Char, Int32, Int32)
Reports the index of the first occurrence of the specified character in this instance ( starting at 0 ). The search starts at the specified character position and checks the specified number of character positions.
String.IndexOf (value, StartIndex, Count)
Parameters
Value: The Unicode character to find.
StartIndex: Search start location.
Count: The number of character positions to check.
return value (INT32):
The index position of value if the character is found, or 1 if not found.
Second, String.LastIndexOf
String.LastIndexOf method
Reports the index position of the last occurrence of the specified Unicode character or String in this instance.
Third, string.substring
String.substring method
Retrieves a substring from this instance.
Name |
Description |
String.substring (Int32) |
Retrieves a substring from this instance. The substring starts at the specified character position. |
String.substring (Int32, Int32) |
Retrieves a substring from this instance. The substring starts at the specified character position and has the specified length.
|
Example: File contents
1$aid_700e5984dba96744
2$aid_b5f0d8ca79ae856e#aid_700e5984dba96744
3$aid_2f0b6558766df9b6#aid_b5f0d8ca79ae856e
C # takes advantage of String class indexof, LastIndexOf, substring to intercept strings