AtC Function | |
Return the position of the first occurrence of a substring within a string, without regard for case.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION AtC(
cSearch AS STRING,
cTarget AS STRING
) AS DWORD
public static uint AtC(
string cSearch,
string cTarget
)
Request Example
View SourceParameters
- cSearch
- Type: String
The substring to search for. - cTarget
- Type: String
The string in which to search.
Return Value
Type:
DWord
The position of the first occurrence of
cSearch within
cTarget.
If
cSearch is not found, AtC() returns 0.
Remarks
If you only need to know whether a substring exists within another string, use the InStr() function or the $ operator.
To find the last occurrence of a substring within a string, use RAt().
Examples
These examples show typical use of AtC():
1? AtC("bcd", "ABCDE")
2? AtC("a", "bcde")
3? AtC("a", "AbCdE")
This example uses strong typing to do the same thing more efficiently:
1LOCAL cSearch AS STRING
2LOCAL cTarget AS STRING
3cSearch := "a"
4cTarget := "AbCdE"
5? AtC(cSearch, cTarget)
See Also Reference
AtC(String, String)