Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354393 - Expect string.indexOf to return 0 if string not found
Summary: Expect string.indexOf to return 0 if string not found
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matt Heitz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 11:22 EDT by Kathy Carroll CLA
Modified: 2017-02-23 14:17 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Carroll CLA 2011-08-10 11:22:01 EDT
If indexOf doesn't find value, I expect to get 0 not -1.  If the string is at the start of the string, I expect 1 not 0.
Comment 1 Matt Heitz CLA 2011-08-10 16:28:07 EDT
I adjusted the functions in EString to account for EGL's 1-based offsets and Java's 0-based offsets.  Changed functions indexOf, lastIndexOf, and charCodeAt.
Comment 2 Kathy Carroll CLA 2011-08-15 14:55:36 EDT
verified
Comment 3 Lisa Lasher CLA 2011-10-11 16:23:46 EDT
Closing this defect.