Forum Discussion

sguda's avatar
sguda
Regular Contributor
15 years ago

How to use Format function to format a string.

I have an string variable that increments in the script everytime the script runs. ex: variable with value 02. Tried to Format this in the form of "0000" using aqstring.Format("0000", Variablestring). I am not able to.  Can you pleasetell me if there is a solution. I tried the format specifics under the format expression with the help. but could not.


  • sguda's avatar
    sguda
    Regular Contributor
    I have string variable with value "2". i want to fomat it to "0002". I used aqstring.format("0000", my string variable with vale :"2").

    I am not able to. can any one suggest.
  • numericString = "2"

    formattedString = aqString.Format("%04i", aqConvert.StrToInt(numericString))