VB character truncation character problem, VB truncation string

Updated on technology 2024-04-13
7 answers
  1. Anonymous users2024-02-07

    s = "I want it.

    The same goes for solar days.

    dim re

    set re = createobject("")= true true

    for each i in

    msgbox

    next

  2. Anonymous users2024-02-06

    Hehe, according to the supplement, it turned out to be to extract these.

    Try my multi-purpose module.

    Let's say your source data is placed in text1 and output to text1.

    private sub command1_click()

    text1 = join(findstrmulti(text1, "aspx"">", ", 0), vbcrlf)

    end sub

    In this module, an array is returned, the first parameter is the original data, the second is the prefix, the third is the suffix, and the fourth parameter is whether to include the prefix and the prefix, (0 means not included, 1 means included).

    public function findstrmulti(strall$, firststr$, endstr$, findmod&) as string()

    dim i&, j&, n&, tmp$()

    redim tmp$(10000)

    doi = instr(i + 1, strall, firststr)

    if i = 0 then exit do

    if findmod = 0 then i = i + len(firststr)

    j = instr(i, strall, endstr)

    if j = 0 then exit do

    if findmod = 1 then j = j + len(endstr)

    tmp(n) = mid(strall, i, j - i)

    n = n + 1

    loopif n > 0 then

    redim preserve tmp$(n - 1)

    findstrmulti = tmp

    end if

    end function

  3. Anonymous users2024-02-05

    flag=0 'Records whether the decimal point has been read.

    for i=1 to len(text(0))

    if mid(text(0),i,1) <"." then

    text(i-flag)=mid(text(0),i,1)

    elseflag=1

    end if

    The next program is displayed in different text controls, which is an array of text controls.

    text(0) is used to input data, and text(1) to text(n) each display a single digit.

    mid function.

    Returns a variant (string) that contains the specified number of characters in the string.

    Syntax mid(string, start[, length]).

    start parameter is required. is the position of the character in the part that is taken out. If start exceeds the number of characters in the string, mid returns a zero-length string ("")。

    length optional parameter; is variant (long). The number of characters to be returned. If you omit or length exceeds the number of characters in the text, including the characters at start, all characters in the string from start to end are returned.

    It is possible that the value of your start variable is greater than the length of the string, resulting in an empty string, or the value of the variable is 0, resulting in an error.

  4. Anonymous users2024-02-04

    Mine is super simple.

    private sub command1_click()dim a as string

    a = 'Must contain 2 decimal places for the amount input.

    if a <>"" then

    right(a, 1) 'points = left(right$(a, 2), 1).'Angle = left(right$(a, 5), 2).'Meta = left$(a, len(a) -5).'$100 end if

    end sub

  5. Anonymous users2024-02-03

    The x-string variable can be implemented with the mid function.

    a=mid(x,1,3)

    b=mid(x,5,3)

  6. Anonymous users2024-02-02

    s = "13011301776 denim trousers 776 40, 38, 36, 35, 34, 33, 32, 31, fall 2011 The first wave"

    dim aa() as string

    aa = split(s, vbtab)

    a=aa(0)

    b=aa(1)

    c=aa(2)

    d=aa(3)

    e=aa(4)

    f=aa(5)

  7. Anonymous users2024-02-01

    private sub command1_click() 'Truncate strings.

    dim tmpstr as string

    for i = 0 to split(text1, vblf)tmpstr = split(split(i, ",")(0), ":")(1)

    mid(tmpstr, 1, len(tmpstr) -2)tmpstr = split(split(i, ",")(1), ":")(1)

    mid(tmpstr, 1, len(tmpstr) -3)end sub 'Not Tested Please notify if there is an error.

Related questions
5 answers2024-04-13

Most of the decimal places in VB are attributes, such as: >>>More

13 answers2024-04-13

y = "China's largest distance basic education service institution and online learning community provide distance education tutoring to primary and secondary school students across the country. "Top 10 Online Educational Institutions". Four middle school synchronization, audio-visual classroom, ** assessment, famous teacher Q&A, mutual help and mutual learning, parent school and other middle school columns, Olympiad Chinese mathematics, happy composition, happy English and other primary school courses. >>>More

4 answers2024-04-13

Create a new project with two forms: form1, form2

There are two controls on form1: command button command1 and timer1There are two controls on form2: label label1 and timer1 click the command button when the program is running, the command button disappears, wait for 1 second and then pop up form 2 display: >>>More

9 answers2024-04-13

The decimal part of the date variable with a value of less than 1 corresponds to the time of day from 0:00:00 to 24:00:00 >>>More

11 answers2024-04-13

First of all, it is necessary to understand what a binary tree is (and I guess the subject also understands). >>>More