Solved

stringlen in C#

Posted on 2008-06-10
2
257 Views
Last Modified: 2013-12-17
if (Strings.Len(cellvalue.Value2) > 0)
how would i write this properly in C#.
0
Comment
Question by:mathieu_cupryk
2 Comments
 
LVL 12

Accepted Solution

by:
jandromeda earned 500 total points
ID: 21756541
If Value2 is of type string then you can get the length of that using,
cellvalue.Value2.Length

So the above line would be,
if (cellvalue.Value2.Length > 0)
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 21756545
Assumeing that cellvalue.Value2 is of type string you can do this.

if (cellvalue.Value2.Length > 0)
{
    // Then the length of the string has characters.
}
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now