You must Sign In to post a response.
  • Category: ASP.NET

    How to get just alphanumeric part from string array


    Plz help me to solve this

    i have some strings like this

    Klassic 78X78X5
    Klassic Plus 78X78X6
    Super Deluxe 78X60X6.00

    i just want to get the dimentiosn of this material i.e, 78X78X5 or 78X78X6.00

    how can i take i used string array but i am not geting the appropriate value for all material plzz help me to solve this.. i am using vs 2010 and c#
  • #761439
    u can split it for space and select the last word.

    eg: string s = "there is a cat";
    // Split string on spaces.
    // ... This will separate all the words.
    string[] words = s.Split(' ');

    Do Good... Enjoy your life.....

  • #761441

    You can try the following code.

    string Test = "Klassic 78X78X5";
    string [] TestArrayL = Test.Split(' ');
    string Diamention = TestArrayL[TestArrayL.Length>0 ? TestArrayL.Length - 1:0] ;

    By Nathan
    Direction is important than speed

  • #761449

    You can try this code for array splitting

    string Test = "Klassic 78X78X5";
    string TestArrayL = Test.Split(' ')[1];

    I have attached snapshots given Below.

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

    Delete Attachment

  • #761465

    You can use Split method to separate the string using some object.

    Refer below sample code

    string str="12X3X4";
    string[] strDimensions= str.Split('X');

    In string array it holds all the dimensions, hope this will helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments