indexof Questions
2
Solved
Not quite grasping what's going on here. Given the array (arr):
[
{
"first_name": "Dan",
"last_name": "Woodson",
"id": 1
},
{
"first_name": "Jen",
"last_name": "Woodson",
"id": 2
},
{
...
Drais asked 23/12, 2011 at 16:13
3
Solved
I can't see any drawbacks in making String.indexOf part of the interface CharSequence. The benefit would be that other classes like StringBuffer or StringBuilder would need to implement the indexOf...
Kiona asked 6/12, 2011 at 6:33
9
Solved
I have generic list which must be a preserved order so I can retrieve the index of an object in the list. The problem is IndexOf is way too slow. If I comment the IndexOf out, the code runs fast as...
Nonmaterial asked 2/7, 2009 at 17:40
2
Solved
I have a txt file as a string, and I need to find words between two characters and Ltrim/Rtrim everything else. It may have to be conditional because the two characters may change depending on the ...
2
I'm really stumped by this one. I'm learning LINQ and used Microsoft Visual C# Express Edition to connect to a SQL Server database containing information about my books. I created the LINQ to SQL c...
Unpaged asked 25/10, 2011 at 17:48
6
Solved
Is there a better way to do this?
string[] s = {"zero", "one", "two", "three", "four", "five"};
var x =
s
.Select((a,i) => new {Value = a, Index = i})
.Where(b => b.Value.StartsWith("t"))
...
3
Solved
I have two selectors
var allNodes = $("a.historyEntry");
var errorNodes = $("a.historyEntry.error");
I would like to to find a node before first error node, so I need to find an index of first...
Acariasis asked 14/10, 2011 at 13:29
5
i have a string which looks like this -
"FirstName||Sam LastName||Jones Address||123 Main ST ..." (100 more different values)
I want to find only Sam and Jones from the entire string.
so string f...
1
Solved
I am able to use LOCATE to get the index of a character such as a . in www.google.com. Thus I can use substring to strip out everything before the first ..
Is there a way I can look for the last /...
3
Solved
Summarization:
TList.IndexOf (TList defined in the unit Classes.pas) iterates linearly through the contained items, and compares the reference. TList.IndexOf (TList defined in the unit Generics.Co...
Robb asked 10/3, 2011 at 21:15
1
Solved
I wrote the following snippet to get rid of excessive spaces in slabs of text
int index = text.IndexOf(" ");
while (index > 0)
{
text = text.Replace(" ", " ");
in...
Ommatophore asked 4/2, 2011 at 0:5
4
Solved
I am trying to write an if else statement in JQuery, which can change an element's class by matching 'IN' or 'OUT'.
For example: I have several <DIV> tags that each have class='IN-something' ...
Salvador asked 17/1, 2011 at 16:51
3
Solved
i'm coming into C++ from Java, and have a common design situation in which i have an element (a non-primitive) that i'd like to remove from a std::vector.
in Java, i'd write something like:
arrayL...
1
I have List which has 150K elements. Average time of work IndexOf() is 4 times lower than Contains(). I tried to use List of int. For List of strings IndexOf is a bit faster.
I found only one main...
3
Solved
I'm running AQTime on this piece of code, I found that .IndexOf takes 16% of the time vs close to 80% for the other piece... They appear to use the same IsEqual and other routines. Called 116,000 t...
Fib asked 7/9, 2010 at 21:46
2
Solved
Well simple question here (maybe not a simple answer?)
Say I have a two dimensional array
[0] [1] [2]
[3] [4] [5]
[6] [7] [8]
Now suppose I want to get the position of the number 6
I know with...
Bendix asked 15/7, 2010 at 23:49
8
Solved
A friend of mine came to me with this strange behavior which i can't explain, any insight view would be appreciated.
Im running VS 2005 (C# 2.0), the following code show the behavior
int rr = "te...
2
Solved
I know that I can return the index of a particular character of a string with the indexof() function, but how can I return the character at a particular index?
© 2022 - 2024 — McMap. All rights reserved.