Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UE4 FString.FindChar doesnt function as stated

UE4F String.FindChar('a', i); In the describtion of the above function i which is an int32 will ahve its value replaced by the position of the char in case the char is found , if not the value will not change.

The bug is that if the char is not found , the value do change to -1 and this is because the implementation of the function is as follows:

 FORCEINLINE bool FindChar( TCHAR InChar, int32& Index ) const
     return Data.Find(InChar, Index);

Where Data.Find is implemented as :

 FORCEINLINE bool Find(const ElementType& Item, int32& Index) const
         Index = this->Find(Item);
         return Index != INDEX_NONE;

Where we can see that the Index equals the Find(Item) that can equal(incase not found) to INDEX_NONE which is a define of value -1 , this was tested and its true that i is replaced with -1 where it value should remain unchanged if the function returns false.

Product Version: UE 4.8
more ▼

asked Jul 03 '15 at 01:53 AM in Bug Reports

avatar image

112 22 21 29

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


I've fixed the FindChar comment, and also in FindLastChar. Thanks for reporting it!

That fix can be found along with other changes here:



more ▼

answered Jul 03 '15 at 11:07 AM

avatar image

Steve Robb STAFF
2.8k 58 28 100

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question