[AccessD] VB.Net - cut and trim

Arthur Fuller fuller.artful at gmail.com
Wed May 9 17:11:07 CDT 2007


When in doubt, add ".ToString()" to any expression that you expected to work
in VBA. You won't be correct 100% of the time, but close.

A.


On 5/9/07, JWColby <jwcolby at colbyconsulting.com> wrote:
>
> I am looking at how to do in VB.Net what in VBA would be str =
> trim(mid(str,intStartPos, intLen))
>
> I can do this (I think) in two steps using:
>
>    private mstr as string
>    mstr = lstrRecord.SubString(intStartPos,intWidth)
>    mstr = mstr.Trim(mstr.ToCharArray)
>
> Given what I know about VB.Net (not very darned much) is this the best
> way?
> I see where the string builder can do the substring part but it does not
> have a trim method.
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list