نمایش نتایج 1 تا 3 از 3

نام تاپیک: معایب stringbuilder

  1. #1
    کاربر دائمی آواتار behrad110
    تاریخ عضویت
    شهریور 1387
    محل زندگی
    sunk below the notes
    پست
    158

    معایب stringbuilder

    از مزایا stringbuilder خیلی صحبت شده و فکر میکنم اکثرا برتری های stringbuilder رو میدونن امامعایبی هم داره که فکر میکنم یکی اش استفاده در برنامه های multi thread هست که ظاهرا اختلالاتی ایجاد میکنه و میگن thread safe نیست . در این مورد و معایب دیگه اگه دوستان مطلب جدیدی دارن .فکر میکنم برای بچه ها مفید باشه .
    در واقع سوال اصلی من این هست که در چه مواردی بهتره از stringbuilder استفاده نکنیم
    ممنون

  2. #2
    کاربر دائمی آواتار behrad110
    تاریخ عضویت
    شهریور 1387
    محل زندگی
    sunk below the notes
    پست
    158

    نقل قول: معایب stringbuilder

    کسی در مورد معایب string builder مطلبی نداره؟ فکر میکنم مفید باشه. بالاخره جا هایی هم وجود داره که string builder مفید نیست

  3. #3
    کاربر دائمی آواتار behrad110
    تاریخ عضویت
    شهریور 1387
    محل زندگی
    sunk below the notes
    پست
    158

    نقل قول: معایب stringbuilder

    The performance of a concatenation operation for a String or StringBuilder object depends on the frequency of memory allocations. A String concatenation operation always allocates memory, whereas a StringBuilder concatenation operation allocates memory only if the StringBuilder object buffer is too small to accommodate the new data. Use the String class if you are concatenating a fixed number of String objects. In that case, the compiler may even combine individual concatenation operations into a single operation. Use a StringBuilder object if you are concatenating an arbitrary number of strings; for example, if you're using a loop to concatenate a random number of strings of user input.
    این از msdn آوردم اما کافی نیست منتظر نظرات تکمیلی دوستان هستم

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •