Remove HTML Tags from an NSString on the iPhone

前端 未结 22 1536
心在旅途
心在旅途 2020-11-22 10:02

There are a couple of different ways to remove HTML tags from an NSString in Cocoa.

One way is to render the string into an

22条回答
  •  一向
    一向 (楼主)
    2020-11-22 10:36

    UITextView *textview= [[UITextView alloc]initWithFrame:CGRectMake(10, 130, 250, 170)];
    NSString *str = @"This is simple";
    [textview setValue:str forKey:@"contentToHTMLString"];
    textview.textAlignment = NSTextAlignmentLeft;
    textview.editable = NO;
    textview.font = [UIFont fontWithName:@"vardana" size:20.0];
    [UIView addSubview:textview];
    

    work fine for me

提交回复
热议问题