To trim a string

How could i trim a string from 29 bytes to 22 bytes.Please let me know ASAP

// assuming myString is length 29.
myString = myString.substring(0, 22);That's 29 characters, not 29 bytes. If you really mean bytes, you can do something like this:
byte[] myArray = myString.getBytes[]
byte[] newArray = new byte[22];
for (int count = 0; count < newArray.length; count++) {
   newArray[count] = myArray[count];
}Michael Bishop

Similar Messages

  • How do I trim a string?

    Is there a function in jsp 2.0 I can left trim or right trim a string?
    Regards,
    GAbriele

    Not sure qhat you are trying to do, but since you can call Java code from a JSP page, it should be relatively straightforward to invoke the trim function from the String class.
    Martin

  • I get an error when I try to trim my string during run-time??

    I am able to get the string inputted in without the trim.. but when i add the trim, the program screws up during run-time..
    i have this in my code...
    input = in.readLine();
    when i put the following afterwards.. it doesn't work:
    input = input.trim();
    what should i do that I am not doing? or what am I doing wrong?

    You don't specify what the error is, if it's a NullPointerException then you just need to check
    if (input != null) {
        String trimmed = input.trim();
        ...

  • About trim() for String

    I am doing assignment to deal with the xml code,for every line I read by BufferedReader I have to trim() it,I mean to take away all the white space in this line before I do something with the xml code.but I cannot make it right.the "trim()" seems doesn't work.
    so I write some small code to test it,
    while(in.ready())
    String line = in.readLine();
    line.trim();
    System.out.println();
    but,unfortunately,I found the "trim()" mothod in String does't work,it does't do anything!
    because on the screen,it print out the excatly same thing as these code
    while(in.ready())
    String line = in.readLine();
    System.out.println();
    it did't take away the white sapce.
    can you help me?thank you very much!

    here is my xml code:
    <database>
         <product>
              <id>No.1</id>
              <name>skateboard</name>
              <type>sports</type>
              <price>$58</price>
         </product>
         <product>
              <id>No.2</id>
              <name>bicycle</name>
              <type>sports</type>
              <price>$122</price>
         </product>
    </database>
    i suppose to have it print out like:
    <database>
    <product>
    <id>No.1</id>
    <name>skateboard</name>
    <type>sports</type>
    <price>$58</price>
    </product>
    <product>
    <id>No.2</id>
    <name>bicycle</name>
    <type>sports</type>
    <price>$122</price>
    /product>
    </database>

  • Trimming a String with Zeros??

    Hi Experts,
    I have a requirment where i need to trim all the zeros at the beginning of the String.
    eg:001500.00 = 1500.00
    How can i trim the leading zeros . i dont see any functions in the String class which does thus..
    Any api's which does that or any easy way to trim them??
    Thanks,

    value = value.replaceFirst("^0+","");

  • Trimming a string using spaces as a delimitter

    I'm trying to retreive email addresses from individual message bodies. I'm using the following code and it is working well :
    <cfset addrpos = ListContainsNoCase(getmail.body, "@", " <> ")>
         <cfif addrpos neq 0>
         <cfset email = ListGetAt(getmail.body, addrpos, " <> ")>
         </cfif>
    For the most part this is working well, but at times the <> characters  are not surrounding the email address in the message bodyand I'm ending up with the email address and a combination of the word before, word after or both. Is there a better way to handle this situation? I tried the following which works when I set the email variable in the example, but does not work when I use the same code in the loop that is getting the original email variable.
    <cfset email = "adfga: [email protected] adfw asdfa">
    <cfset addrpos1 = ListContainsNoCase(email, "@", " ")>
    <cfset EMAIL = ListGetAt(email, addrpos1, " ")>
    I looked at the GetToken function but did not think that it would be a better way to go at it. Any other ideas?

    Finding email addresses in a bunch of text without using regular expressions? Mad, I say, Mad!
    Hints:
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7e 9a.html
    Try using regular expression to match any valid email:
    [A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}
    Allow returnsubexpressions on ReFind to return multiple hits on the message body.
    Use cfdump to check how you must access the result array.
    Hope this helps.
    - Fernis - fernis.net - ColdFusion Developer For Hire

  • String Trimming Issue

    Hello, All.
    In one of my JSP's, I retrieve search parameters a user entered on a form add it to the session. I then redisplay the data to the when they return to the JSP. What's happening is that when the data is redisplayed in the text fields, it shows as if there are leading spaces or tabs. I do a string trim before I add the data to the session, but this does not seem to work. I have also tried trimming the string after retrieving the data from the session object.
    I have also confirmed that the length of the data item placed in the session is the same as the length of the item once I retrieve it from the session. I'm not sure, but I believe it may be inserting tabs into the text fields. Anyone out there know what's going on? Any assistance is appreciated. Thanks much.

    I use the following code to retrieve the data from the html form and run it through my cleanParam method, which just trims it:
    String name = cleanParam(request.getParameter("compname"));
    I then add the code to the session after I've performed processing on the data:
    session.setAttribute("name", name);
    The html form has the following code to display data:
    <input type="text" name="compname" size="30" maxlength="30" value=
    <%if(!isEmptyString(getSessionString(session, "name"))){%>"
    <%= session.getAttribute("name") %>"<%}else{%>"<%=name%>"<%}%>>
    Thanks.

  • Setting input fields to an empty string BIG PROBLEM

    Hi Rob, thanks for your rerply, It makes sense alright, but I am using 2 seperate input fields. I have discovered what is causing the problem .
    After the user types into the inputfield and moves on to a different frame, I have set the input field to an empty string and this is what is causing the problem.
    I have tried setting the input field to an empty string in a movie script and on individual sprites and the first right answer is not excepted.I have to type in the right answer twice to get get a right response. I am actually using three seperate input fields in total, each with a different name and behavior. Even If I use one input field I still have the same problem. Its driving me crazey. Any Ideas.
    Anne

    I believe that the FIM Service always does trims on string, so you may be out of luck.
    What is your scenario / what are you trying to accomplish by setting a space in an attribute? A space is not an empty string in my definition.
    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

  • Problems with string comparing

    I have a function, getPlayerName() that returns the contents of a text field, but i want the dialog box to check and see if there was anything typed in there, so i have done things like if(this.getPlayerName() != null), if(this.getPlayerName() != "") and if(this.getPlayerName() != " "), and the statement still lets it go by when i dont type anything in. is there something else i'm suppose to do?

    When comparing strings (and any other object for that matter) you must use the equals method. In your case you should probably also trim the string for whitespace before comparing:
    if(!this.getPlayerName().trim().equals("")) In this case you can also use the length method:
    if(this.getPlayerName().trim().length() != 0)

  • Exception in thread "main" java.lang.NumberFormatException:For input String

    this is a code about arrylist. but when I debug it.it metion:Exception in thread "main" java.lang.NumberFormatException:For input String at java.lang.NumberFormatException.forInputString(numberFomatExceptionio java:48)
    at java.lang.Integer.parseInt(integer.java:468)
    at java.lang.Integer.parseInt(integer.java:497)
    at Get.getInt(manerger.java:208)
    at LinkList.insertFirst(manager.java:94)
    at manager.main(manager.java;20)
    this is my code:
    import java.io.*;
    import java.lang.*;
    public class manager
         public static void main(String args[]) throws IOException
         LinkList list=new LinkList();
         System.out.println("input S can scan the grade\ninput D can delete one entry\ninput U can update the entry\ninput A can add one entry\ninput E can end");
         int cr=System.in.read();
    switch(cr)
         case 'A':
         list.insertFirst();break;//this is 20 row
         case 'S':
         System.out.println("input the s");break;
         case 'D':
         System.out.println("input the d");break;
         case 'U':
         System.out.println("input the u");break;
    class Link
    public int number;
    public String name=new String();
    public int chs;
    public int eng;
    public int math;
    public Link next;
    public Link(int number,String name, int chs,int eng,int math)
    this.number=number;
    this.name=name;
    this.chs=chs;
    this.eng=eng;
    this.math=math;
    public Link()
         this(0,"",0,0,0);
    public void displayLink()
    System.out.println(number + " "+name+ " "+chs+ " "+eng+ " "+math+ " ");
    class LinkList
    public Link first;
    public LinkList()
    first = null;
    public boolean isEmpty()
    return first==null;
    public void displayList()
         System.out.println("");
         Link current=first;
         while(current!=null)
              current.displayLink();
              current=current.next;
         System.out.println("");
    public Link insertFirst() throws IOException
         Get getdata=new Get();
         int number=getdata.getInt();//this is 94 row
         String name=getdata.getString();
         int chs=getdata.getInt();
         int eng=getdata.getInt();
         int math=getdata.getInt();
         Link newLink = new Link(number,name,chs,eng,math);
         first=newLink;
         return first;
    public Link find(int key)
         Link current=first;
         while(current.number!=key)
              if(current.next==null)
              return null;
              else
              current=current.next;
         return current;
    public Link update(int key) throws IOException
         Link current=first;
         while(current.number!=key)
         if(current.next==null)
         return null;
         else
              System.out.println("Input the first letter of the subject:");
         int c=System.in.read();
         Get get=new Get();
              switch(c)
                   case 'c':
                   current.chs=get.getInt();break;
                   case 'e':
                   current.eng=get.getInt();break;
                   case 'm':
                   current.math=get.getInt();break;
         return current;
    public float average(char key)
         Link current=first;
         float total=0;
         float average=0;
         float counter=0;
         if(current==null)
         return 0;
         while(current!=null)
              switch(key)
                   case 'c':
                   total=current.chs+current.next.chs;break;
                   case 'e':
                   total=current.eng+current.next.eng;break;
                   case 'm':
                   total=current.math+current.next.math;break;
              current=current.next.next;
              counter++;
         average=total/counter;
         return average;
    public Link delete(int key)
         Link current=first;
         Link previous=first;
         while(current.number!=key)
              if(current.next==null)
              return null;
              else
                   previous=current;
                   current=current.next;
              if(current==first)
              first=first.next;
              else
              previous.next=current.next;
              return current;
    class Get
    public static String getString() throws IOException
    System.out.println("Input your name:");
    InputStreamReader str = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(str);
    String s = br.readLine();
    return s;
    public static int getInt() throws IOException
    System.out.println("Input your data:");
    String st = getString();
    return Integer.parseInt(st);//this is 208 row
    }

    It may be that the code in getString() returns a
    String that ends with a newline. If that is the
    problem, you can use
    return (Integer.parseInt(st)).trim();1. getString will never return a String ending in newline. BufferedReader.readLine strips off the newline.
    2. Even if you had a newline, String.trim doesn't trim newlines.
    3. You would need to trim the String, not the int:
    return (Integer.parseInt(st.trim()));As JimDinosaur said, you are passing bad data (the value of "st").
    In getInt, add this before trying to parse "st":
    System.out.println("###"+st+"###");What does it print?

  • What to do when readString() fails and String[] out of bounds ?

    Dear Java People,
    I have a runtime error message that says:
    stan_ch13_page523.InvalidUserInputException: readString() failed. Input data is not a string
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    below is the program
    thank you in advance
    Norman
    import java.io.*;
    import java.util.*;
    public class FormattedInput
        // Method to read an int value
        public int readInt()
          for(int i = 0; i < 2; i ++)
          if(readToken() == tokenizer.TT_NUMBER)
            return (int)tokenizer.nval;   // value is numeric so return as int
          else
            System.out.println("Incorrect input: " + tokenizer.sval +
               " Re-enter as integer");
            continue;         //retry the read operation
          } // end of for loop
          System.out.println("Five failures reading an int value" + " - program terminated");
          System.exit(1);  // end the program
          return 0;
         public double readDouble() throws InvalidUserInputException
           if(readToken() != tokenizer.TT_NUMBER)
              throw new InvalidUserInputException(" readDouble() failed. " + " Input data not numeric");
           return tokenizer.nval;
         public String readString() throws InvalidUserInputException
           if(readToken() == tokenizer.TT_WORD || ttype == '\"' ||  ttype == '\'')
            return tokenizer.sval;
           else
             throw new InvalidUserInputException(" readString() failed. " + " Input data is not a string");
           //helper method to read the next token
           private int readToken()
             try
               ttype = tokenizer.nextToken();
               return ttype;
             catch(IOException e)
               e.printStackTrace(System.err);
               System.exit(1);
              return 0;
           //object to tokenize input from the standard input stream
           private StreamTokenizer tokenizer = new StreamTokenizer(
                                                new BufferedReader(
                                                 new InputStreamReader(System.in)));
           private int ttype;                  //stores the token type code
    import java.io.*;
    import java.util.*;
    public class TryVectorAndSort
         public static void main(String[] args)
        Person aPerson;           // a Person object
        Crowd filmCast = new Crowd();
        //populate the crowd
        for( ; ;)
          aPerson = readPerson();
          if(aPerson == null)
            break;   // if null is obtained we break out of the for loop
          filmCast.add(aPerson);
        int count = filmCast.size();
        System.out.println("You added " + count + (count == 1 ? " person":  " people ") + "to the cast.\n");
        //Show who is in the cast using an iterator
         Iterator myIter = filmCast.iterator();
        //output all elements
        while(myIter.hasNext() )
          System.out.println(myIter.next());
        }//end of main
          //read a person from the keyboard
          static public Person readPerson()
         FormattedInput in = new FormattedInput();
            //read in the first name and remove blanks front and back
            System.out.println("\nEnter first name or ! to end:");
            String firstName = "";
            try
            firstName = in.readString().trim(); //read and trim a string
            catch(InvalidUserInputException e)
            e.printStackTrace(System.err);
            //check for a ! entered. If so we are done
            if(firstName.charAt(0) == '!')
              return null;
            //read the last name also trimming the blanks
            System.out.println("Enter last name:");
            String lastName= "";
            try
              lastName = in.readString().trim(); //read and trim a string
            catch(InvalidUserInputException e)
             e.printStackTrace(System.err);
            return new Person(firstName, lastName);
    //when I ran the program the output I received was:
    import java.io.StreamTokenizer;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    public class InvalidUserInputException extends Exception
       public InvalidUserInputException() { }
          public InvalidUserInputException(String message)
              super(message);
    import java.util.*;
    class Crowd
      public Crowd()
        //Create default Vector object to hold people
         people = new Vector();
      public Crowd(int numPersons)
        //create Vector object to hold  people with given capacity
         people = new Vector(numPersons);
        //add a person to the crowd
        public boolean add(Person someone)
          return people.add(someone);
         //get the person at the given index
          Person get(int index)
          return (Person)people.get(index);
         //get the numbers of persons in the crowd
          public int size()
            return people.size();
          //get  people store capacity
          public int capacity()
            return people.capacity();
          //get a listIterator for the crowd
          public Iterator iterator()
            return people.iterator();
            //A Vector implements the List interface (that has the static sort() method
            public void sort()
              Collections.sort(people);
          //Person store - only accessible through methods of this class
          private Vector people;
    public class Person implements Comparable
      public Person(String firstName, String lastName)
        this.firstName = firstName;
        this.lastName = lastName;
      public String toString()
        return firstName + "  " + lastName;
       //Compare Person objects
        public int compareTo(Object person)
           int result = lastName.compareTo(((Person)person).lastName);
           return result == 0 ? firstName.compareTo(((Person)person).firstName):result;
      private String firstName;
      private String lastName;

    Dear Nasch,
    ttype is declared in the last line of the FormattedInput class
    see below
    Norman
    import java.io.*;
    import java.util.*;
    public class FormattedInput
        // Method to read an int value
        public int readInt()
          for(int i = 0; i < 2; i ++)
          if(readToken() == tokenizer.TT_NUMBER)
            return (int)tokenizer.nval;   // value is numeric so return as int
          else
            System.out.println("Incorrect input: " + tokenizer.sval +
               " Re-enter as integer");
            continue;         //retry the read operation
          } // end of for loop
          System.out.println("Five failures reading an int value" + " - program terminated");
          System.exit(1);  // end the program
          return 0;
         public double readDouble() throws InvalidUserInputException
           if(readToken() != tokenizer.TT_NUMBER)
              throw new InvalidUserInputException(" readDouble() failed. " + " Input data not numeric");
           return tokenizer.nval;
         public String readString() throws InvalidUserInputException
           if(readToken() == tokenizer.TT_WORD || ttype == '\"' ||  ttype == '\'')
             System.out.println(tokenizer.sval);
            return tokenizer.sval;
           else
             throw new InvalidUserInputException(" readString() failed. " + " Input data is not a string");
           //helper method to read the next token
           private int readToken()
             try
               ttype = tokenizer.nextToken();
               return ttype;
             catch(IOException e)
               e.printStackTrace(System.err);
               System.exit(1);
              return 0;
           //object to tokenize input from the standard input stream
           private StreamTokenizer tokenizer = new StreamTokenizer(
                                                new BufferedReader(
                                                 new InputStreamReader(System.in)));
           private int ttype;                  //stores the token type code
         }

  • Trim up to a certain character

    hi everyone, i hope someone can help me with this.
    i have a string that I need to trim up to a pipe character ("|"). the problem is, the length of the characters before this pipe character varies greatly. How can I trim the string (for example, abcdef346 | rfgt...) and get only abcdef346 as the result?
    any help would be greatly appreciated.

    Try this
    Code Snippet
    SELECT
    LEFT(column_name,(charindex('|',coulmn_name)-1))
    as columnname
    FROM table_name
     Thanks Magnal 
     Your query helped me too.
    Just a word of caution that it will break if there are values without | character at all
    so a much safer approach would be this
    SELECT LTRIM(RTRIM(LEFT(column_name,charindex('|',coulmn_name + '|')-1))) as columnname
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Parsing an equation within a string

    Well my friend and i are making a calculator which has the ability to take a String (the equation) and format it for calculation using the order of operations (PEMDAS).
    What we have so far is it reads the equation from a textbox and passes the string to our prcoess void which atm looks like this:
        public static void process(String s){
            textfield_rawLine.setText("");
            s = s.trim().toLowerCase();
            String ans = String.valueOf(partAnswer);
            BasicOps.textfield_Answer.setText(ans);
        }the float variable partAnswer was left over from something else i tried ealier. We want to handle the numbers as floats for more accurate precision. At the moment we can handle simple equations, 4 + 3 etc, but not more complex such as (4 + 3) - (6 * 4) etc. Any ideas how we can accomplish what we need?

    the generally accepted way is to convert the infix notation (4 + 3) into postfix notation (4 3 +) and then use a simple stack based processor to perform the math. The infix to postfix transformation, while not brain-dead simple, isn't particularly hard, either. There are probably loads of samples on the net.

  • Removing number of characters from end of string

    Hi all....
    Dooza very kindly helped me with trimming a string in an
    earlier post, but
    now i want to remove the last four characters from a string.
    I really should know how to do this and will have to do some
    bedtime reading
    :-|
    But, for now, could someone help!
    Thanks
    Andy

    Ah Dooza - Thank You.
    To the rescue again :-D
    You're helping me to see the logic...
    Thanks Again
    Andy
    "Dooza" <[email protected]> wrote in message
    news:gbafel$ra3$[email protected]..
    > Andy wrote:
    >> Hi all....
    >> Dooza very kindly helped me with trimming a string
    in an earlier post,
    >> but now i want to remove the last four characters
    from a string.
    >> I really should know how to do this and will have to
    do some bedtime
    >> reading :-|
    >>
    >> But, for now, could someone help!
    >
    > Hi Andy,
    > Try something like this:
    > <%
    > myStr = "this is my really long string"
    > Response.Write(LEFT(myStr,LEN(myStr) -4))
    > %>
    >
    > Dooza

  • LabView String StartsWith functionality like in C#?

    Hello all,
    in C# (.NET) there is a good class: String
    There it is possible e.g. to get information, if the string startswith a special substring.
    Is there such possibility in LabView? Is there such LabView vi, which offers this functionality? (Some snippet?)
    Why I am asking:
    I want to create a switch/case-block (case-structure) in labview for this code:
    if(string.startswith("XYZ"))  step into case1
    else if(string.startswith("DEF")) step into case2
    BTW:
    It would be so nice if anybody could create polymorphic VI with these functions: 
    (from C# string class)
    public object Clone();
    public static int Compare(string strA, string strB);
    public static int Compare(string strA, string strB, bool ignoreCase);
    public static int Compare(string strA, string strB, StringComparison comparisonType);
    public static int Compare(string strA, string strB, bool ignoreCase, CultureInfo culture);
    public static int Compare(string strA, string strB, CultureInfo culture, CompareOptions options);
    public static int Compare(string strA, int indexA, string strB, int indexB, int length);
    public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase);
    public static int Compare(string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType);
    public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture);
    public static int Compare(string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options);
    public static int CompareOrdinal(string strA, string strB);
    public static int CompareOrdinal(string strA, int indexA, string strB, int indexB, int length);
    public int CompareTo(object value);
    public int CompareTo(string strB);
    public static string Concat(IEnumerable<string> values);
    public static string Concat<T>(IEnumerable<T> values);
    public static string Concat(object arg0);
    public static string Concat(params object[] args);
    public static string Concat(params string[] values);
    public static string Concat(object arg0, object arg1);
    public static string Concat(string str0, string str1);
    public static string Concat(object arg0, object arg1, object arg2);
    public static string Concat(string str0, string str1, string str2);
    public static string Concat(object arg0, object arg1, object arg2, object arg3);
    public static string Concat(string str0, string str1, string str2, string str3);
    public bool Contains(string value);
    public static string Copy(string str);
    public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);
    public bool EndsWith(string value);
    public bool EndsWith(string value, StringComparison comparisonType);
    public bool EndsWith(string value, bool ignoreCase, CultureInfo culture);
    public override bool Equals(object obj);
    public bool Equals(string value);
    public static bool Equals(string a, string b);
    public bool Equals(string value, StringComparison comparisonType);
    public static bool Equals(string a, string b, StringComparison comparisonType);
    public static string Format(string format, object arg0);
    public static string Format(string format, params object[] args);
    public static string Format(IFormatProvider provider, string format, params object[] args);
    public static string Format(string format, object arg0, object arg1);
    public static string Format(string format, object arg0, object arg1, object arg2);
    public CharEnumerator GetEnumerator();
    public override int GetHashCode();
    public TypeCode GetTypeCode();
    public int IndexOf(char value);
    public int IndexOf(string value);
    public int IndexOf(char value, int startIndex);
    public int IndexOf(string value, int startIndex);
    public int IndexOf(string value, StringComparison comparisonType);
    public int IndexOf(char value, int startIndex, int count);
    public int IndexOf(string value, int startIndex, int count);
    public int IndexOf(string value, int startIndex, StringComparison comparisonType);
    public int IndexOf(string value, int startIndex, int count, StringComparison comparisonType);
    public int IndexOfAny(char[] anyOf);
    public int IndexOfAny(char[] anyOf, int startIndex);
    public int IndexOfAny(char[] anyOf, int startIndex, int count);
    public string Insert(int startIndex, string value);
    public static string Intern(string str);
    public static string IsInterned(string str);
    public bool IsNormalized();
    public bool IsNormalized(NormalizationForm normalizationForm);
    public static bool IsNullOrEmpty(string value);
    public static bool IsNullOrWhiteSpace(string value);
    public static string Join(string separator, IEnumerable<string> values);
    public static string Join<T>(string separator, IEnumerable<T> values);
    public static string Join(string separator, params object[] values);
    public static string Join(string separator, params string[] value);
    public static string Join(string separator, string[] value, int startIndex, int count);
    public int LastIndexOf(char value);
    public int LastIndexOf(string value);
    public int LastIndexOf(char value, int startIndex);
    public int LastIndexOf(string value, int startIndex);
    public int LastIndexOf(string value, StringComparison comparisonType);
    public int LastIndexOf(char value, int startIndex, int count);
    public int LastIndexOf(string value, int startIndex, int count);
    public int LastIndexOf(string value, int startIndex, StringComparison comparisonType);
    public int LastIndexOf(string value, int startIndex, int count, StringComparison comparisonType);
    public int LastIndexOfAny(char[] anyOf);
    public int LastIndexOfAny(char[] anyOf, int startIndex);
    public int LastIndexOfAny(char[] anyOf, int startIndex, int count);
    public string Normalize();
    public string Normalize(NormalizationForm normalizationForm);
    public string PadLeft(int totalWidth);
    public string PadLeft(int totalWidth, char paddingChar);
    public string PadRight(int totalWidth);
    public string PadRight(int totalWidth, char paddingChar);
    public string Remove(int startIndex);
    public string Remove(int startIndex, int count);
    public string Replace(char oldChar, char newChar);
    public string Replace(string oldValue, string newValue);
    public string[] Split(params char[] separator);
    public string[] Split(char[] separator, int count);
    public string[] Split(char[] separator, StringSplitOptions options);
    public string[] Split(string[] separator, StringSplitOptions options);
    public string[] Split(char[] separator, int count, StringSplitOptions options);
    public string[] Split(string[] separator, int count, StringSplitOptions options);
    public bool StartsWith(string value);
    public bool StartsWith(string value, StringComparison comparisonType);
    public bool StartsWith(string value, bool ignoreCase, CultureInfo culture);
    public string Substring(int startIndex);
    public string Substring(int startIndex, int length);
    public char[] ToCharArray();
    public char[] ToCharArray(int startIndex, int length);
    public string ToLower();
    public string ToLower(CultureInfo culture);
    public string ToLowerInvariant();
    public override string ToString();
    public string ToString(IFormatProvider provider);
    public string ToUpper();
    public string ToUpper(CultureInfo culture);
    public string ToUpperInvariant();
    public string Trim();
    public string Trim(params char[] trimChars);
    public string TrimEnd(params char[] trimChars);
    public string TrimStart(params char[] trimChars);
    Eugen Wiebe
    Bernstein AG
    CLAD - Certified LabView Associate Developer
    Solved!
    Go to Solution.

    Why I am asking:
    I want to create a switch/case-block (case-structure) in labview for this code:
    This can be done already with the case structure, you can do simple parsing in the case selector, which takes a string as an input.
    Type into the case for first case "XYZ....XYZ~"
    Type into next case "DEF...DEF~"
    Next case is empty string, default.
    How does this work:
    The "XYZ...XYZ~"  matches all strings that start with XYZ and have any ascii value after the ~ is the highest printable 7bit ascii value so this catches all other characters.
    Option 2 is parse (there are very good reg expression vi in the string palette) the string and create interger value if a matched then habdle the unique integers in the case structure.
    There are so many ways to do it without making a wrapper for the .net string class, I provided a few quick methods
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

Maybe you are looking for

  • Fillable form check boxes won't check

    Hi there, I've just created a fillable form with check boxes. They worked fine to start with but when you close the document and reopen it, you can click the boxes but they just flash and don't fill in. Has anyone else had this problem and know how t

  • Nokia n80 endles faults

    k.. firstly it started with the charger deciding to stop working, i was told its a common fault and had to purchase a new charger. next, sending text messages seemed to be a major flaw, it takes up to two mins to send a msg n if that wernt bad enough

  • Mac Pro has started crashing

    Hello!  My wifes' Mac Pro has begun to crash regularly, and it seems more frequently as well.  Here are its' charachteristics:   Model Name:    Mac Pro   Model Identifier:    MacPro1,1   Processor Name:    Dual-Core Intel Xeon   Processor Speed:    2

  • ATI Catalyst 13.4 Released

    GOOD NEWS:  About 20 minutes of quick testing reveals this new AMD driver release seems to work with all of Photoshop's functions and features, and reports an appropriate amount of VRAM to Photoshop. As a bonus, a quick set of benchmarks reveals it's

  • Just bought ipad, hooked to my sons computer and it linked up with his itunes account. i want to hook it up to my wifes itunes because it is her ipad. have i screwed up or is it possible to do this

    just bought an ipad for my wife. hooked it to my sons computer and it linked up with his itunes. the problem is its not his ipad and i want to sync it to my wifes itunes. have i screwed up or can i wipe his off yhe ipad and sync with hers?