Results 1 to 3 of 3

Thread: Check for a ";".

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    300

    Check for a ";".

    Hello everyone.

    How can I detect any line that has ")" at the line,
    and has NOTHING after it, and then add ";" after it?

    Like, before;

    "xoslize.value(50)"

    after;

    "xoslize.value(50);"

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,538

    Re: Check for a ";".

    Check to see if the string EndsWith the ) and go from there.

    Code:
            If sn.EndsWith(")") Then
    
            End If
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Check for a ";".

    Like this:
    Code:
    If str.Substring(str.Length - 1, 1) = ")" Then
        str &= ";"
    End If
    If your lines have a CR or CRLF then you may have to modify the starting location and adding the ";" to the end will not work.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width