首页 > 试题广场 >

请补全以下代码生成指定长度,内容随机的字符串。 @impl

[问答题]
请补全以下代码生成指定长度,内容随机的字符串。
@implementation NSString (RandomString)
#pragma mark - Random String
+ (NSString *)randomStringWithLength:(NSUInteger)length
{
    static char const possibleChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()_-/?;:+=[]|~<>";
    
    // Write your code here
  
}
@end

这道题你会答吗?花几分钟告诉大家答案吧!