1 / 30

Microsoft Visual Basic 2005: Reloaded Second Edition

Microsoft Visual Basic 2005: Reloaded Second Edition. Chapter 6 String Manipulation and More Controls. The Insert Method. Insert method : used to insert characters anywhere within a string startIndex argument : specifies where in the string to insert the value

Download Presentation

Microsoft Visual Basic 2005: Reloaded Second Edition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 6 String Manipulation and More Controls

  2. The Insert Method • Insert method: used to insert characters anywhere within a string • startIndex argument: specifies where in the string to insert the value • string argument: the string being manipulated • value argument: the character(s) to be inserted Microsoft Visual Basic 2005: Reloaded, Second Edition

  3. The Insert Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  4. The Insert Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  5. The Insert Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  6. The Insert Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  7. The Insert Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  8. Search a String for One or More Characters • StartsWith method: determines whether a specific sequence of characters occurs at the beginning of a string • EndsWith method: determines whether a specific sequence of characters occurs at the end of a string • subString argument: the sequence of characters to be searched for • StartsWith and EndsWith methods: • Return Boolean values • Perform a case-sensitive search Microsoft Visual Basic 2005: Reloaded, Second Edition

  9. Search a String for One or More Characters (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  10. Search a String for One or More Characters (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  11. Search a String for One or More Characters (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  12. Search a String for One or More Characters (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  13. Search a String for One or More Characters (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  14. The Contains Method • Contains method: • Determines if a string contains a specific sequence of characters • Is a method of the String class • subString argument: represents the sequence of characters to be searched for • string argument: the string in which to search Microsoft Visual Basic 2005: Reloaded, Second Edition

  15. The Contains Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  16. The Contains Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  17. The Contains Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  18. The Contains Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  19. The Contains Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  20. The IndexOf Method • IndexOf method: returns an integer representing the location of a substring within a string • Performs a case-sensitive search • subString argument: sequence of characters to be searched for • string argument: the string to be searched • startIndex argument: the starting position for the search (zero-relative) Microsoft Visual Basic 2005: Reloaded, Second Edition

  21. The IndexOf Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  22. The IndexOf Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  23. The IndexOf Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  24. The IndexOf Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  25. The IndexOf Method (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  26. Accessing Characters Contained in a String • SubString method: accesses any number of characters contained in a string • startIndex argument: index of the first character to be accessed (zero-relative) • string argument: the string containing the characters to be accessed • count argument: number of characters to be accessed Microsoft Visual Basic 2005: Reloaded, Second Edition

  27. Accessing Characters Contained in a String (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  28. Accessing Characters Contained in a String (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  29. Accessing Characters Contained in a String (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

  30. Accessing Characters Contained in a String (continued) Microsoft Visual Basic 2005: Reloaded, Second Edition

More Related