There is a new v1.45.1 snapshot release. You can find out more and download the release for Windows or Mac at:
Please try it and let us know if you have any issues.
There is a new v1.45.1 snapshot release. You can find out more and download the release for Windows or Mac at:
Please try it and let us know if you have any issues.
Wow! This is a really great and useful update. Renaming the columns, correlation, and the copy and paste options are really appreciated.
RENAMING COLUMNS !!
COPY HEADER only
Using IndexOf in the Calculate
If the value that you are looking for is an empty string then it still gives zero which is wrong it should return -1 or am I missing something?
Searching content value of column 4 in content value of column 1.
A what position does an empty string exist in a non-empty string is up there with βDoes the set that contains all non-empty sets contain itsself?β and " What is the sound of one hand clapping?". ;0)
In Excel:
Find( ββ, βxyzβ ) returns 1 (1-based index)
Find( βxyzβ, ββ ) returns an empty cell
Find( ββ, ββ ) returns an empty cell
In Qt/C++:
QString( βxyzβ ).indexOf( ββ ) returns 0 (0-based index)
QString( ββ ).indexOf( βxyzβ ) returns -1
QString( ββ ).indexOf( ββ ) returns 0 (0-based index)
In Javascript:
βxyzβ.indexOf( ββ ) returns 0 (0-based index)
ββ.indexOf( βxyzβ ) returns -1 (0-based index)
ββ.indexOf( ββ ) returns 0 (0-based index)
So all 3 implementations agree that a non-empty string contains an empty string at the first position.
They also agree that an empty string does not contain a non-empty string (non-controversial).
But they differ on the philosophical question of whether an empty string contains an empty string.
The Filter transform considers that an empty string contains an empty string, so I am going to go with that.
So I think the current implemntation will stay, except that I will probably change from 0-based to 1-based, as it is more intuitive for non-programmers.
Learned something new, that empty string still gets the position.
From Excle. I used (Find(c2,a2)-1) so that index value is zero based.
str | 2 | 3 | i1 | i2 |
---|---|---|---|---|
467β¦114β¦ | 467 | 114 | 0 | 5 |
β¦*β¦ | * | 3 | 0 | |
β¦35β¦633. | 35 | 633 | 2 | 6 |
β¦#β¦ | # | 6 | 0 | |
617*β¦ | 617 | * | 0 | 3 |
β¦+.58. | + | 58 | 5 | 7 |
β¦592β¦ | 592 | 2 | 0 | |
β¦755. | 755 | 6 | 0 | |
β¦$.*β¦ | $ | * | 3 | 5 |
.664.598β¦ | 664 | 598 | 1 | 5 |
So that mean, I should check first the string I am trying to search is not null and then use it.
I think so. I will think about it a bit more.
I did some tests on the C++ lastIndexOf() method and:
QString( βxyzβ ).lastIndexOf( ββ ) returns 2 (0-based index)
QString( ββ ).lastIndexOf( βxyzβ ) returns -1
QString( ββ ).lastIndexOf( ββ ) returns -1
It seems strange that QString( ββ ).indexOf( ββ ) and QString( ββ ).lastIndexOf( ββ ) have different results! Hmmm.