pratikshahse
asked on
How to use indexof property in C#
How do i translate this VB6 code to C#
test = InStr(1, strText, vbTab)
I tried
test = strText.Tostring().Indexof ('\t',0) -- but did not work
test = InStr(1, strText, vbTab)
I tried
test = strText.Tostring().Indexof
ASKER
actually this is what i have
object item = lstMfgColors.SelectedItems [I];
string o = item.ToString().Indexof("\ t",0);
object item = lstMfgColors.SelectedItems
string o = item.ToString().Indexof("\
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is that what you need?
Maybe some sourcecode around it would be more explanatory...
Maybe some sourcecode around it would be more explanatory...
Could you please explain what this code does exactly:
test = InStr(1, strText, vbTab)
test = InStr(1, strText, vbTab)
try this:
- Use a string variable type string:
string segment = str.Substring(index1,len);
where segment is a variable to store the substring,
str is the original string,
index1 is the zero-based starting position of the substring that you want to extract,
len is the number of characters you wish to extract.
This should resolve it.
- Use a string variable type string:
string segment = str.Substring(index1,len);
where segment is a variable to store the substring,
str is the original string,
index1 is the zero-based starting position of the substring that you want to extract,
len is the number of characters you wish to extract.
This should resolve it.
test = strText.Indexof("\t")+1